Commit 5d1044c335b033714744f286105d24980fb57f04
1 parent
056fa05b
Exists in
master
and in
4 other branches
Fix Commit#to_diff
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
app/models/commit.rb
| @@ -159,6 +159,8 @@ class Commit | @@ -159,6 +159,8 @@ class Commit | ||
| 159 | while !lines.first.start_with?("diff --git") do | 159 | while !lines.first.start_with?("diff --git") do |
| 160 | lines.shift | 160 | lines.shift |
| 161 | end | 161 | end |
| 162 | + lines.pop if lines.last =~ /^[\d.]+$/ # Git version | ||
| 163 | + lines.pop if lines.last == "-- " # end of diff | ||
| 162 | lines.join("\n") | 164 | lines.join("\n") |
| 163 | end | 165 | end |
| 164 | end | 166 | end |