Commit c2cfc52e449a7bcd817909ace4ab8926509ee4f2
1 parent
570f63da
Exists in
master
and in
4 other branches
fix merge request diff
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/views/merge_requests/_diffs.html.haml
| 1 | -- @diffs.each do |diff| | 1 | +- @diffs.each_with_index do |diff, i| |
| 2 | - next if diff.diff.empty? | 2 | - next if diff.diff.empty? |
| 3 | - file = (@commit.tree / diff.b_path) | 3 | - file = (@commit.tree / diff.b_path) |
| 4 | - next unless file | 4 | - next unless file |
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | %br/ | 12 | %br/ |
| 13 | .diff_file_content | 13 | .diff_file_content |
| 14 | - if file.text? | 14 | - if file.text? |
| 15 | - = render :partial => "commits/text_file", :locals => { :diff => diff } | 15 | + = render :partial => "commits/text_file", :locals => { :diff => diff, :index => i } |
| 16 | - elsif file.image? | 16 | - elsif file.image? |
| 17 | .diff_file_content_image | 17 | .diff_file_content_image |
| 18 | %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} | 18 | %img{:src => "data:#{file.mime_type};base64,#{Base64.encode64(file.data)}"} |