Fix merge conflict reading for new diffs

This commit is contained in:
Sean McGivern 2016-07-29 11:05:33 +01:00 committed by Fatih Acet
parent 10321bf862
commit 28ef06c52b
2 changed files with 3 additions and 3 deletions

View file

@ -204,7 +204,7 @@ class MergeRequest < ActiveRecord::Base
def diff_start_commit
if persisted?
merge_request_diff.start_commit
merge_request_diff.start_commit || target_branch_head
else
target_branch_head
end
@ -212,7 +212,7 @@ class MergeRequest < ActiveRecord::Base
def diff_head_commit
if persisted?
merge_request_diff.head_commit
merge_request_diff.head_commit || source_branch_head
else
source_branch_head
end

View file

@ -5,7 +5,7 @@ module Gitlab
def initialize(merge_request)
@merge_request = merge_request
@our_commit = merge_request.diff_head_commit.raw.raw_commit
@our_commit = merge_request.source_branch_head.raw.raw_commit
@their_commit = merge_request.target_branch_head.raw.raw_commit
end