summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-02-03 19:30:53 +0000
committerJacob Schatz <jschatz@gitlab.com>2017-02-03 19:30:53 +0000
commitd5a9e934815471096010844c647ec523ad4e82a9 (patch)
tree22c35efa461cdef9ad664bb5affd4a37513b0596
parent785fadf33fb23c4c95edeaa84ef5bd267ce753d5 (diff)
parent7c583293cda3be8def5c665000a540124c838122 (diff)
downloadgitlab-ce-d5a9e934815471096010844c647ec523ad4e82a9.tar.gz
Merge branch '26829-diff-unfolding-links-erroneously-present-on-no-newline-lines' into 'master'
Prevent "nonewline" type diff lines from showing a diff unfolding link Closes #26829 See merge request !8632
-rw-r--r--app/views/projects/diffs/_parallel_view.html.haml12
1 files changed, 10 insertions, 2 deletions
diff --git a/app/views/projects/diffs/_parallel_view.html.haml b/app/views/projects/diffs/_parallel_view.html.haml
index f361204ecac..98d78af2e45 100644
--- a/app/views/projects/diffs/_parallel_view.html.haml
+++ b/app/views/projects/diffs/_parallel_view.html.haml
@@ -8,8 +8,12 @@
- last_line = right.new_pos if right
%tr.line_holder.parallel
- if left
- - if left.meta?
+ - case left.type
+ - when 'match'
= diff_match_line left.old_pos, nil, text: left.text, view: :parallel
+ - when 'nonewline'
+ %td.old_line.diff-line-num
+ %td.line_content.match= left.text
- else
- left_line_code = diff_file.line_code(left)
- left_position = diff_file.position(left)
@@ -21,8 +25,12 @@
%td.line_content.parallel
- if right
- - if right.meta?
+ - case right.type
+ - when 'match'
= diff_match_line nil, right.new_pos, text: left.text, view: :parallel
+ - when 'nonewline'
+ %td.new_line.diff-line-num
+ %td.line_content.match= right.text
- else
- right_line_code = diff_file.line_code(right)
- right_position = diff_file.position(right)