Build diff_refs for merge request if merge request diff does not exist

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2016-08-02 17:52:20 +03:00
parent 7cb8ceb5b9
commit fc8d2fbc94
No known key found for this signature in database
GPG key ID: 627C5F589F467F17

View file

@ -250,6 +250,12 @@ class MergeRequest < ActiveRecord::Base
def diff_refs
if merge_request_diff
merge_request_diff.diff_refs
elsif diff_start_commit || diff_base_commit
Gitlab::Diff::DiffRefs.new(
base_sha: diff_base_sha,
start_sha: diff_start_sha,
head_sha: diff_head_sha
)
end
end