summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-12-12 23:07:52 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-12-12 23:07:52 +0800
commitc0dfa0c609805558b30f11046eedadfb8a14886d (patch)
tree3f684f5e108ebbff9673b112c7aa597eacdd86fa /app
parente0df1b5f9944cff1ee7234c9fa292a7a06456c08 (diff)
downloadgitlab-ce-c0dfa0c609805558b30f11046eedadfb8a14886d.tar.gz
Not sure why, but apparently SHA works better
It's very weird that source_commit.raw_commit and rugged.branches[merge_request.target_branch].target should be completely the same. I checked with == and other values which proved that both should be the same, but still tests cannot pass for: spec/services/merge_requests/refresh_service_spec.rb I decided to give it up. We could just use SHA and that works fine anyway.
Diffstat (limited to 'app')
-rw-r--r--app/models/repository.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 44f66b89600..7a7236993a8 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -903,8 +903,8 @@ class Repository
def merge(user, merge_request, options = {})
GitOperationService.new(user, self).with_branch(
merge_request.target_branch) do |source_commit|
- our_commit = source_commit.raw_commit
- their_commit = rugged.lookup(merge_request.diff_head_sha)
+ our_commit = source_commit.sha
+ their_commit = merge_request.diff_head_sha
raise 'Invalid merge target' unless our_commit
raise 'Invalid merge source' unless their_commit