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-02-02 00:49:20 +0300
committerDouwe Maan <douwe@selenight.nl>2017-02-07 01:12:24 +0300
commit6edc8d50dcec3252fd5afa244f9ade2e062f920d (patch)
treea837f220409adda5c7482396b2f78a53da2acdd8 /app/controllers/projects/compare_controller.rb
parent3dfb6a309442b181f179e854fdfe13f80f493616 (diff)
Add feature specs
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r--app/controllers/projects/compare_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb
index 142df1ba4e9..d5cca827e9f 100644
--- a/app/controllers/projects/compare_controller.rb
+++ b/app/controllers/projects/compare_controller.rb
@@ -57,8 +57,8 @@ class Projects::CompareController < Projects::ApplicationController
@diffs = @compare.diffs(diff_options)
- branch_name = @head_ref if @repository.branch_exists?(@head_ref)
- @environment = @project.environments_for(commit: @commit, ref: branch_name).last
+ environment_args = @repository.branch_exists?(@head_ref) ? { ref: @head_ref } : { commit: @commit }
+ @environment = @project.environments_for(**environment_args).last
@environment = nil unless can?(current_user, :read_environment, @environment)
@diff_notes_disabled = true