Commit 5d1044c335b033714744f286105d24980fb57f04

Authored by Riyad Preukschas
1 parent 056fa05b

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 159 while !lines.first.start_with?("diff --git") do
160 160 lines.shift
161 161 end
  162 + lines.pop if lines.last =~ /^[\d.]+$/ # Git version
  163 + lines.pop if lines.last == "-- " # end of diff
162 164 lines.join("\n")
163 165 end
164 166 end
... ...