Commit 8f52501eb579923a86f94efac8286f8897faec93
1 parent
5d092945
Exists in
master
and in
4 other branches
Fix inline diff issue. See #3150
Showing
2 changed files
with
4 additions
and
5 deletions
Show diff stats
app/controllers/commit_controller.rb
lib/gitlab/inline_diff.rb
... | ... | @@ -21,8 +21,9 @@ module Gitlab |
21 | 21 | end |
22 | 22 | end |
23 | 23 | first_token = first_line[0..first_the_same_symbols][1..-1] |
24 | - diff_arr[index+1].sub!(first_token, first_token + START) | |
25 | - diff_arr[index+2].sub!(first_token, first_token + START) | |
24 | + start = first_token + START | |
25 | + diff_arr[index+1].sub!(first_token, first_token => start) | |
26 | + diff_arr[index+2].sub!(first_token, first_token => start) | |
26 | 27 | last_the_same_symbols = 0 |
27 | 28 | (1..max_length + 1).each do |i| |
28 | 29 | last_the_same_symbols = -i |
... | ... | @@ -60,8 +61,6 @@ module Gitlab |
60 | 61 | line.gsub!(FINISH, "</span>") |
61 | 62 | line |
62 | 63 | end |
63 | - | |
64 | 64 | end |
65 | - | |
66 | 65 | end |
67 | 66 | end | ... | ... |