From 5d1044c335b033714744f286105d24980fb57f04 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Sat, 22 Dec 2012 20:36:33 +0100 Subject: [PATCH] Fix Commit#to_diff --- app/models/commit.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/commit.rb b/app/models/commit.rb index ee16bf08..f11b7fe0 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -159,6 +159,8 @@ class Commit while !lines.first.start_with?("diff --git") do lines.shift end + lines.pop if lines.last =~ /^[\d.]+$/ # Git version + lines.pop if lines.last == "-- " # end of diff lines.join("\n") end end