diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-17 09:23:00 -0500 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-05-17 20:59:26 +0300 |
commit | d3b24a7638de71ee1286200978e0b6d0b33d0753 (patch) | |
tree | 498c4ed238cae6026acc38cb087a3152ee20dfa3 /app/controllers | |
parent | fb67ea491ba86cb012e58d0e338039acd61400dd (diff) | |
download | gitlab-ce-d3b24a7638de71ee1286200978e0b6d0b33d0753.tar.gz |
Show last commit for current tree on tree page
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/tree_controller.rb | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 9489bbddfc4..87721fbe2f5 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -42,6 +42,8 @@ class Projects::BlobController < Projects::ApplicationController environment_params = @repository.branch_exists?(@ref) ? { ref: @ref } : { commit: @commit } @environment = EnvironmentsFinder.new(@project, current_user, environment_params).execute.last + @last_commit = @repository.last_commit_for_path(@commit.id, @blob.path) + render 'show' end diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 3ce65b29b3c..f8eb8e00a5d 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -24,6 +24,8 @@ class Projects::TreeController < Projects::ApplicationController end end + @last_commit = @repository.last_commit_for_path(@commit.id, @tree.path) || @commit + respond_to do |format| format.html # Disable cache so browser history works |