summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-11 17:55:23 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-08-11 17:55:23 +0800
commit0a9d9f7d5096aa742564e704a96fa7c40eeaf007 (patch)
treefda9863a9b7e3216ec3830f078626625c1915747 /app
parent4b559c9afb34b80b910efec514653c6ea65adba8 (diff)
downloadgitlab-ce-0a9d9f7d5096aa742564e704a96fa7c40eeaf007.tar.gz
Fetch the current SHA if SHA was not passed
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index dc9b4b38a10..2969bec0bf7 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -1086,7 +1086,8 @@ class Project < ActiveRecord::Base
!namespace.share_with_group_lock
end
- def pipeline_for(ref, sha)
+ def pipeline_for(ref, sha = commit(ref).try(:sha))
+ return unless sha
pipelines.order(id: :desc).find_by(sha: sha, ref: ref)
end