diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-01 15:49:20 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-06 16:12:24 -0600 |
commit | 6edc8d50dcec3252fd5afa244f9ade2e062f920d (patch) | |
tree | a837f220409adda5c7482396b2f78a53da2acdd8 /app/controllers/projects/compare_controller.rb | |
parent | 3dfb6a309442b181f179e854fdfe13f80f493616 (diff) | |
download | gitlab-ce-6edc8d50dcec3252fd5afa244f9ade2e062f920d.tar.gz |
Add feature specs
Diffstat (limited to 'app/controllers/projects/compare_controller.rb')
-rw-r--r-- | app/controllers/projects/compare_controller.rb | 4 |
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 |