Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-01-29 22:38:00 +0300
committerDouwe Maan <douwe@selenight.nl>2017-02-07 01:12:23 +0300
commit27f2ca94181880861269a7ddc07ae0d50a656d35 (patch)
treef93a26a7bf263e448f24230950db618bcd73b8f5 /app/controllers/projects/compare_controller.rb
parentd147688af4adb6bcd6cb0f18797c70a8a451f4fa (diff)
Add 'View on [env]' link to blobs and individual files in diffs
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r--app/controllers/projects/compare_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index 321cde255c3..6c94a79f842 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -57,6 +57,10 @@ class Projects::CompareController < Projects::ApplicationController
@diffs = @compare.diffs(diff_options)
+ branch_name = @head_ref if @repository.branch_exists?(@head_ref)
+ @environment = @project.latest_environment_for(@commit, ref: branch_name)
+ @environment = nil unless can?(current_user, :read_environment, @environment)
+
@diff_notes_disabled = true
@grouped_diff_discussions = {}
end