diff options
author | Regis Boudinot <boudinot.regis@yahoo.com> | 2017-05-19 05:12:47 +0300 |
---|---|---|
committer | Regis Boudinot <boudinot.regis@yahoo.com> | 2017-05-19 05:12:47 +0300 |
commit | e2d7eb8863abd445ddf0b5b83c01d0b5c4da67dd (patch) | |
tree | f7567a28b271e9d335c41160eb4f290cde735435 /app | |
parent | 8e225051f46ecdcc1ec0fecdf615b1a3e15e655b (diff) | |
parent | b8ca5c784ca8c5eea886f04c0b03cdac729bae9c (diff) |
Merge branch 'dm-no-conflicts-when-branches-are-missing-9-2' into '9-2-stable'
Stop MR conflict code from blowing up when branches are missing (9.2)
See merge request !11502
Diffstat (limited to 'app')
-rw-r--r-- | app/models/merge_request.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 1b6904aa077..e88a86ea0f0 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -299,6 +299,8 @@ class MergeRequest < ActiveRecord::Base attr_writer :target_branch_sha, :source_branch_sha def source_branch_head + return unless source_project + source_branch_ref = @source_branch_sha || source_branch source_project.repository.commit(source_branch_ref) if source_branch_ref end @@ -919,6 +921,7 @@ class MergeRequest < ActiveRecord::Base return @conflicts_can_be_resolved_in_ui = false unless cannot_be_merged? return @conflicts_can_be_resolved_in_ui = false unless has_complete_diff_refs? + return @conflicts_can_be_resolved_in_ui = false if branch_missing? begin # Try to parse each conflict. If the MR's mergeable status hasn't been updated, |