summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-14 13:09:36 +0100
committerDouwe Maan <douwe@gitlab.com>2016-01-14 13:09:36 +0100
commit05187f0fc671e1ddcbe6d7b0f76971d792acaada (patch)
tree8a59142453f319cb3d58622ed259377ebc79d674
parent4d64a32c88dd5f87621d391c0f10f6acef094073 (diff)
downloadgitlab-ce-05187f0fc671e1ddcbe6d7b0f76971d792acaada.tar.gz
Properly generate diff of orphan commits, like the first commit in a repository
-rw-r--r--CHANGELOG1
-rw-r--r--lib/gitlab/diff/parser.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index f874145ec86..4bd871826f6 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 8.4.0 (unreleased)
+ - Properly generate diff of orphan commits, like the first commit in a repository
- Autocomplete data is now always loaded, instead of when focusing a comment text area (Yorick Peterse)
- Improved performance of finding issues for an entire group (Yorick Peterse)
- Added custom application performance measuring system powered by InfluxDB (Yorick Peterse)
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
index 7015fe36c3d..516e59b87a3 100644
--- a/lib/gitlab/diff/parser.rb
+++ b/lib/gitlab/diff/parser.rb
@@ -56,8 +56,9 @@ module Gitlab
private
def filename?(line)
- line.start_with?('--- /dev/null', '+++ /dev/null', '--- a', '+++ b',
- '--- /tmp/diffy', '+++ /tmp/diffy')
+ line.start_with?( '--- /dev/null', '+++ /dev/null', '--- a', '+++ b',
+ '+++ a', # The line will start with `+++ a` in the reverse diff of an orphan commit
+ '--- /tmp/diffy', '+++ /tmp/diffy')
end
def identification_type(line)