diff options
author | Sean McGivern <sean@gitlab.com> | 2016-08-01 14:50:08 +0100 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-08-12 23:24:45 +0300 |
commit | 10cf933f70657eb0c413259319a103e15abd9f5c (patch) | |
tree | a0770ce44b38273d2a9477022ab678a4c4ebc885 /lib/gitlab/conflict | |
parent | 66ffa28e65515d48eb5576aa77b5e0668067b53b (diff) | |
download | gitlab-ce-10cf933f70657eb0c413259319a103e15abd9f5c.tar.gz |
Highlight files based on merged file
Diffstat (limited to 'lib/gitlab/conflict')
-rw-r--r-- | lib/gitlab/conflict/file.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/conflict/file.rb b/lib/gitlab/conflict/file.rb index bbabcf265f3..3d2b7272bad 100644 --- a/lib/gitlab/conflict/file.rb +++ b/lib/gitlab/conflict/file.rb @@ -59,8 +59,11 @@ module Gitlab end def highlight_lines! - their_highlight = Gitlab::Highlight.highlight_lines(repository, their_ref, their_path) - our_highlight = Gitlab::Highlight.highlight_lines(repository, our_ref, our_path) + their_file = lines.reject { |line| line.type == 'new' }.map(&:text).join("\n") + our_file = lines.reject { |line| line.type == 'old' }.map(&:text).join("\n") + + their_highlight = Gitlab::Highlight.highlight(their_path, their_file, repository: repository).lines.map(&:html_safe) + our_highlight = Gitlab::Highlight.highlight(our_path, our_file, repository: repository).lines.map(&:html_safe) lines.each do |line| if line.type == 'old' |