summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-05-18 22:13:20 +0000
committerRobert Speicher <robert@gitlab.com>2017-05-18 22:13:20 +0000
commitbcc504d3c3ed0436935ca076d6be5db5ca10a664 (patch)
tree88abcddab66bde62a1177548c2f785dddf42282c /app
parente5cc8e0aa81c3012eff5303543b11931158478cf (diff)
parent7a7e9288d4dea50a9797b3f624bf8174fa7060d4 (diff)
downloadgitlab-ce-bcc504d3c3ed0436935ca076d6be5db5ca10a664.tar.gz
Merge branch 'dm-no-conflicts-when-branches-are-missing' into 'master'
Stop MR conflict code from blowing up when branches are missing Closes #32544 See merge request !11501
Diffstat (limited to 'app')
-rw-r--r--app/models/merge_request.rb2
-rw-r--r--app/services/merge_requests/conflicts/list_service.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index d7e7ae7a25f..9be00880438 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -293,6 +293,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
diff --git a/app/services/merge_requests/conflicts/list_service.rb b/app/services/merge_requests/conflicts/list_service.rb
index 9bf82518643..9835606812c 100644
--- a/app/services/merge_requests/conflicts/list_service.rb
+++ b/app/services/merge_requests/conflicts/list_service.rb
@@ -15,6 +15,7 @@ module MergeRequests
return @conflicts_can_be_resolved_in_ui = false unless merge_request.cannot_be_merged?
return @conflicts_can_be_resolved_in_ui = false unless merge_request.has_complete_diff_refs?
+ return @conflicts_can_be_resolved_in_ui = false if merge_request.branch_missing?
begin
# Try to parse each conflict. If the MR's mergeable status hasn't been