Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
fd100e1e
Commit
fd100e1e
authored
Dec 30, 2015
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't modify "match" diff lines. #3945
parent
8b079315
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
lib/gitlab/diff/highlight.rb
lib/gitlab/diff/highlight.rb
+6
-1
spec/lib/gitlab/diff/highlight_spec.rb
spec/lib/gitlab/diff/highlight_spec.rb
+5
-0
No files found.
lib/gitlab/diff/highlight.rb
View file @
fd100e1e
...
...
@@ -25,7 +25,12 @@ module Gitlab
def
update_diff_lines
@highlighted_code
.
lines
.
each_with_index
do
|
line
,
i
|
@diff_lines
[
i
].
text
=
"
#{
@diff_line_prefixes
[
i
]
}#{
line
}
"
diff_line
=
@diff_lines
[
i
]
# ignore highlighting for "match" lines
next
if
diff_line
.
type
==
'match'
diff_line
.
text
=
"
#{
@diff_line_prefixes
[
i
]
}#{
line
}
"
end
@diff_lines
...
...
spec/lib/gitlab/diff/highlight_spec.rb
View file @
fd100e1e
...
...
@@ -24,5 +24,10 @@ describe Gitlab::Diff::Highlight, lib: true do
it
'should keep the inline diff markup'
do
expect
(
diff_lines
[
5
].
text
).
to
match
(
Regexp
.
new
(
Regexp
.
escape
(
'<span class="idiff">RuntimeError, </span>'
)))
end
it
'should not modify "match" lines'
do
expect
(
diff_lines
[
0
].
text
).
to
eq
(
'@@ -6,12 +6,18 @@ module Popen'
)
expect
(
diff_lines
[
22
].
text
).
to
eq
(
'@@ -19,6 +25,7 @@ module Popen'
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment