summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-01-13 21:04:53 -0500
committerRubén Dávila <rdavila84@gmail.com>2016-01-13 21:04:53 -0500
commitc179b48c97be22ef55ef9f5874984f7359fb12f1 (patch)
treecb0f5c8f03df34f8735487f5ee2a5136a3b54d10 /lib
parent1161cf2ec610cb0ceba61c92180566c9786ab059 (diff)
downloadgitlab-ce-c179b48c97be22ef55ef9f5874984f7359fb12f1.tar.gz
Use #sub instead of #gsub!. #3945
* This is because is not a good idea to modify the original lines * Also I run into this issue https://gitlab.com/gitlab-org/gitlab_git/issues/14 which is returning Diff Lines with the same @new_pos value.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/diff/highlight.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/diff/highlight.rb b/lib/gitlab/diff/highlight.rb
index f940b57d596..e76a6f27856 100644
--- a/lib/gitlab/diff/highlight.rb
+++ b/lib/gitlab/diff/highlight.rb
@@ -73,7 +73,7 @@ module Gitlab
# Only update text if line is found. This will prevent
# issues with submodules given the line only exists in diff content.
- line.text = highlighted_line.gsub!(/\A\s/, line_prefix).html_safe if highlighted_line
+ line.text = highlighted_line.sub(/\A\s/, line_prefix).html_safe if highlighted_line
end
@lines