Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRubén Dávila <rdavila84@gmail.com>2016-01-14 05:04:53 +0300
committerRubén Dávila <rdavila84@gmail.com>2016-01-14 05:04:53 +0300
commitc179b48c97be22ef55ef9f5874984f7359fb12f1 (patch)
treecb0f5c8f03df34f8735487f5ee2a5136a3b54d10 /lib/gitlab/diff
parent1161cf2ec610cb0ceba61c92180566c9786ab059 (diff)
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/gitlab/diff')
-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