diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-25 22:05:05 +0300 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-08-26 19:30:17 +0300 |
commit | 52b07013e7aec539b864299744090e331408a550 (patch) | |
tree | b9a7708b67057aa3a114a8a561da3af0671d59a9 /app | |
parent | e618ce28a0862c4bda9d0db4ba843ca79c15d31b (diff) |
Merge branch '21275-getting-500-error-when-viewing-a-merge-request'
Diffstat (limited to 'app')
-rw-r--r-- | app/models/merge_request.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 5330a07ee35..19a684d1d0c 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -777,8 +777,12 @@ class MergeRequest < ActiveRecord::Base return @conflicts_can_be_resolved_in_ui = false unless has_complete_diff_refs? begin - @conflicts_can_be_resolved_in_ui = conflicts.files.each(&:lines) - rescue Gitlab::Conflict::Parser::ParserError, Gitlab::Conflict::FileCollection::ConflictSideMissing + # Try to parse each conflict. If the MR's mergeable status hasn't been updated, + # ensure that we don't say there are conflicts to resolve when there are no conflict + # files. + conflicts.files.each(&:lines) + @conflicts_can_be_resolved_in_ui = conflicts.files.length > 0 + rescue Rugged::OdbError, Gitlab::Conflict::Parser::ParserError, Gitlab::Conflict::FileCollection::ConflictSideMissing @conflicts_can_be_resolved_in_ui = false end end |