summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-08-04 10:31:44 +0100
committerFatih Acet <acetfatih@gmail.com>2016-08-12 23:24:48 +0300
commit427e724698185169536d68e95873415038286849 (patch)
tree8a114686469f751c6aef02361b8a83fa344f1f54 /lib
parent5277239c3e2d843f04397dce572a647f3bd79bdf (diff)
downloadgitlab-ce-427e724698185169536d68e95873415038286849.tar.gz
Don't allow resolving invalid conflicts
An MR can only be resolved in the UI if: - It has conflicts. - It has valid diff_refs (in other words, it supports new diff notes). - It has no conflicts with one side missing. - It has no conflicts in binary files. - It has no conflicts in files too large to display. - It has no conflicts containing invalid conflict markers.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/conflict/file.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/conflict/file.rb b/lib/gitlab/conflict/file.rb
index 1d63aec6903..cdbb63f626f 100644
--- a/lib/gitlab/conflict/file.rb
+++ b/lib/gitlab/conflict/file.rb
@@ -69,9 +69,9 @@ module Gitlab
lines.each do |line|
if line.type == 'old'
- line.rich_text = their_highlight[line.old_line - 1].html_safe
+ line.rich_text = their_highlight[line.old_line - 1].try(:html_safe)
else
- line.rich_text = our_highlight[line.new_line - 1].html_safe
+ line.rich_text = our_highlight[line.new_line - 1].try(:html_safe)
end
end
end