summaryrefslogtreecommitdiff
path: root/app/controllers/projects/blob_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-01 15:49:20 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-06 16:12:24 -0600
commit6edc8d50dcec3252fd5afa244f9ade2e062f920d (patch)
treea837f220409adda5c7482396b2f78a53da2acdd8 /app/controllers/projects/blob_controller.rb
parent3dfb6a309442b181f179e854fdfe13f80f493616 (diff)
downloadgitlab-ce-6edc8d50dcec3252fd5afa244f9ade2e062f920d.tar.gz
Add feature specs
Diffstat (limited to 'app/controllers/projects/blob_controller.rb')
-rw-r--r--app/controllers/projects/blob_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index c88095abb3a..e7d61510624 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -30,8 +30,8 @@ class Projects::BlobController < Projects::ApplicationController
end
def show
- branch_name = @ref if @repository.branch_exists?(@ref)
- @environment = @project.environments_for(commit: @commit, ref: branch_name).last
+ environment_args = @repository.branch_exists?(@ref) ? { ref: @ref } : { commit: @commit }
+ @environment = @project.environments_for(**environment_args).last
@environment = nil unless can?(current_user, :read_environment, @environment)
end