summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-10-27 21:56:03 +0100
committerPhil Hughes <me@iamphill.com>2017-10-27 21:56:03 +0100
commit496c750e3f387624fd51a37954efe87ef6b465bd (patch)
treeb94bd0e1b1e0e7ae179cd2cdb91aa194d7276eb2 /app/models/project.rb
parent90b06afdeaa13fe14218a53c8afbc4802af53a27 (diff)
parentdfd6c3f824ada5558546b809fd32468325788b94 (diff)
downloadgitlab-ce-ph-multi-file-upload-file.tar.gz
Merge branch 'master' into ph-multi-file-upload-fileph-multi-file-upload-file
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 4689b588906..7185b4d44fc 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -540,6 +540,10 @@ class Project < ActiveRecord::Base
repository.commit(ref)
end
+ def commit_by(oid:)
+ repository.commit_by(oid: oid)
+ end
+
# ref can't be HEAD, can only be branch/tag name or SHA
def latest_successful_builds_for(ref = default_branch)
latest_pipeline = pipelines.latest_successful_for(ref)
@@ -553,7 +557,7 @@ class Project < ActiveRecord::Base
def merge_base_commit(first_commit_id, second_commit_id)
sha = repository.merge_base(first_commit_id, second_commit_id)
- repository.commit(sha) if sha
+ commit_by(oid: sha) if sha
end
def saved?