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:
authorMatija Čupić <matteeyah@gmail.com>2019-07-17 16:33:52 +0300
committerMatija Čupić <matteeyah@gmail.com>2019-07-23 21:55:59 +0300
commit7cee6139c07db7ba4fd6febf74c24dbfaee8e59d (patch)
treee140f84706d0067f7a788bb4aa9ee677b3851f2b /app/controllers/projects/artifacts_controller.rb
parentd892e80bf0161b535389c91ccb53539e4f08d790 (diff)
Find build by sha from ref
Adds ability to find builds by sha when only specifying a ref.
Diffstat (limited to 'app/controllers/projects/artifacts_controller.rb')
-rw-r--r--app/controllers/projects/artifacts_controller.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/projects/artifacts_controller.rb b/app/controllers/projects/artifacts_controller.rb
index 2ef18d900f2..da8a371acaa 100644
--- a/app/controllers/projects/artifacts_controller.rb
+++ b/app/controllers/projects/artifacts_controller.rb
@@ -92,7 +92,10 @@ class Projects::ArtifactsController < Projects::ApplicationController
def build_from_ref
return unless @ref_name
- project.latest_successful_build_for(params[:job], @ref_name)
+ commit = project.commit(@ref_name)
+ return unless commit
+
+ project.latest_successful_build_for_sha(params[:job], commit.id)
end
def artifacts_file