Unify pipeline_for(ref, nil) and pipeline_for(ref), feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/5142#note_14073464
This commit is contained in:
parent
9c9259cc6a
commit
1aba3a5c0e
1 changed files with 4 additions and 1 deletions
|
@ -1094,8 +1094,11 @@ class Project < ActiveRecord::Base
|
|||
!namespace.share_with_group_lock
|
||||
end
|
||||
|
||||
def pipeline_for(ref, sha = commit(ref).try(:sha))
|
||||
def pipeline_for(ref, sha = nil)
|
||||
sha ||= commit(ref).try(:sha)
|
||||
|
||||
return unless sha
|
||||
|
||||
pipelines.order(id: :desc).find_by(sha: sha, ref: ref)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue