提交 c0dfa0c6 编写于 作者: L Lin Jen-Shin

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.
上级 e0df1b5f
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册