Commit 8f52501eb579923a86f94efac8286f8897faec93

Authored by Dmitriy Zaporozhets
1 parent 5d092945

Fix inline diff issue. See #3150

app/controllers/commit_controller.rb
... ... @@ -11,7 +11,7 @@ class CommitController < ProjectResourceController
11 11 result = CommitLoadContext.new(project, current_user, params).execute
12 12  
13 13 @commit = result[:commit]
14   -
  14 +
15 15 if @commit.nil?
16 16 git_not_found!
17 17 return
... ...
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
... ...