summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-01-27 17:23:59 +0100
committerDouwe Maan <douwe@selenight.nl>2016-01-27 17:23:59 +0100
commit5cce1278adb168cd9fa4f189e3656a59726b4e6c (patch)
tree61e78e71ef377095abf6e3df3bee5a027ce5989a /app/models/project.rb
parenta93f7099fa2ed98746ebfb5e55322d0afb5068f8 (diff)
downloadgitlab-ce-5cce1278adb168cd9fa4f189e3656a59726b4e6c.tar.gz
Correctly determine MR diff base when MR has merge conflicts
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 4bd51449c25..488dc98c17f 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -348,6 +348,10 @@ class Project < ActiveRecord::Base
repository.commit(id)
end
+ def merge_base_commit(first_commit_id, second_commit_id)
+ repository.commit(repository.merge_base(first_commit_id, second_commit_id))
+ end
+
def saved?
id && persisted?
end