diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-09-04 16:13:24 +0400 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-09-08 11:05:17 +0400 |
commit | 721b75733c49117100a5caf04bf6040fe6004dca (patch) | |
tree | e079954eb95eabf9407e4b8c72f7efa9a5df31b3 /app | |
parent | dc7554d020f7e278f30c8d4c4113a19f7c3cd82f (diff) |
Take the next type into consideration
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/commits_helper.rb | 4 | ||||
-rw-r--r-- | app/views/projects/commits/_parallel_view.html.haml | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index fe6c303ecf2..b3249e520a4 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -25,8 +25,8 @@ module CommitsHelper def side_diff_line(diff, index) Gitlab::DiffParser.new(diff.diff.lines.to_a, diff.new_path) - .each do |full_line, type, line_code, line_new, line_old, raw_line, next_line| - yield(full_line, type, line_code, line_new, line_old, raw_line, next_line) + .each do |full_line, type, line_code, line_new, line_old, raw_line, next_type, next_line| + yield(full_line, type, line_code, line_new, line_old, raw_line, next_type, next_line) end end diff --git a/app/views/projects/commits/_parallel_view.html.haml b/app/views/projects/commits/_parallel_view.html.haml index 97e1c884b7b..7debc44e132 100644 --- a/app/views/projects/commits/_parallel_view.html.haml +++ b/app/views/projects/commits/_parallel_view.html.haml @@ -1,7 +1,7 @@ / Side-by-side diff view %div.text-file %table - - side_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line, next_line| + - side_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line, next_type, next_line| %tr.line_holder.parallel{ id: line_code } - if type == "match" = render "projects/commits/diffs/match_line_parallel", {line: line, @@ -25,7 +25,8 @@ %td.new_line{class: "#{type}", data: {linenumber: line_new}} = link_to raw(line_new) , "##{line_code}", id: line_code - if type == 'old' - %td.line_content.parallel{class: "noteable_line new #{line_code}", "line_code" => line_code}= raw next_line + - content = next_type == 'new' ? next_line : " " + %td.line_content.parallel{class: "noteable_line new #{line_code}", "line_code" => line_code}= raw content - else %td.line_content.parallel{class: "#{type}"}= raw line |