diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-12-10 13:52:30 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-12-10 13:52:30 +0300 |
commit | c79c8739b69e46d1f4384ad136da5ba03572df1d (patch) | |
tree | 1fc6d6dcac8333eb2ed5c9c0b9c4b9bcb9817492 /app | |
parent | 5a727a4d36674d02369f4ef8ed257ea9d17570e7 (diff) | |
parent | 401f65c43aa12aa712daa8ddfb00a4fb731541c8 (diff) |
Merge branch '54626-able-to-download-a-single-archive-file-with-api-by-ref-name' into 'master'
Add endpoint to download single artifact by ref
Closes #54626
See merge request gitlab-org/gitlab-ce!23538
Diffstat (limited to 'app')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index f5dc58cd67f..075c07f5c8e 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -655,6 +655,11 @@ class Project < ActiveRecord::Base end end + def latest_successful_build_for(job_name, ref = default_branch) + builds = latest_successful_builds_for(ref) + builds.find_by!(name: job_name) + end + def merge_base_commit(first_commit_id, second_commit_id) sha = repository.merge_base(first_commit_id, second_commit_id) commit_by(oid: sha) if sha |