diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-18 22:13:20 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-05-18 22:13:20 +0000 |
commit | bcc504d3c3ed0436935ca076d6be5db5ca10a664 (patch) | |
tree | 88abcddab66bde62a1177548c2f785dddf42282c /app | |
parent | e5cc8e0aa81c3012eff5303543b11931158478cf (diff) | |
parent | 7a7e9288d4dea50a9797b3f624bf8174fa7060d4 (diff) | |
download | gitlab-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.rb | 2 | ||||
-rw-r--r-- | app/services/merge_requests/conflicts/list_service.rb | 1 |
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 |