diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-12 16:43:58 +0300 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-12 16:43:58 +0300 |
| commit | 8f52501eb579923a86f94efac8286f8897faec93 (patch) | |
| tree | ff66e2956ba4be654d951c7bcb85ec96debae7bd | |
| parent | 5d0929458cc502fd4f4981103d6d3a88ebb8e377 (diff) | |
| download | gitlab-ce-8f52501eb579923a86f94efac8286f8897faec93.tar.gz | |
Fix inline diff issue. See #3150
| -rw-r--r-- | app/controllers/commit_controller.rb | 2 | ||||
| -rw-r--r-- | lib/gitlab/inline_diff.rb | 7 |
2 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/commit_controller.rb b/app/controllers/commit_controller.rb index 0f696ef9f5a..a164de33107 100644 --- a/app/controllers/commit_controller.rb +++ b/app/controllers/commit_controller.rb @@ -11,7 +11,7 @@ class CommitController < ProjectResourceController result = CommitLoadContext.new(project, current_user, params).execute @commit = result[:commit] - + if @commit.nil? git_not_found! return diff --git a/lib/gitlab/inline_diff.rb b/lib/gitlab/inline_diff.rb index b39fd0d552d..44cf49b4047 100644 --- a/lib/gitlab/inline_diff.rb +++ b/lib/gitlab/inline_diff.rb @@ -21,8 +21,9 @@ module Gitlab end end first_token = first_line[0..first_the_same_symbols][1..-1] - diff_arr[index+1].sub!(first_token, first_token + START) - diff_arr[index+2].sub!(first_token, first_token + START) + start = first_token + START + diff_arr[index+1].sub!(first_token, first_token => start) + diff_arr[index+2].sub!(first_token, first_token => start) last_the_same_symbols = 0 (1..max_length + 1).each do |i| last_the_same_symbols = -i @@ -60,8 +61,6 @@ module Gitlab line.gsub!(FINISH, "</span>") line end - end - end end |
