Commit c179b48c authored by Rubén Dávila's avatar Rubén Dávila

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.
parent 1161cf2e
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment