summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-22 20:36:33 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2012-12-22 20:36:33 +0100
commit5d1044c335b033714744f286105d24980fb57f04 (patch)
treec1dc0372cb454bada77eaf74b84c709d4d8837c7
parent056fa05b869a8e12700bf56934e93ca76abb2db7 (diff)
downloadgitlab-ce-5d1044c335b033714744f286105d24980fb57f04.tar.gz
Fix Commit#to_diff
-rw-r--r--app/models/commit.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index ee16bf084de..f11b7fe0202 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