Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-01-14 15:09:36 +0300
committerDouwe Maan <douwe@gitlab.com>2016-01-14 15:09:36 +0300
commit05187f0fc671e1ddcbe6d7b0f76971d792acaada (patch)
tree8a59142453f319cb3d58622ed259377ebc79d674 /lib/gitlab/diff
parent4d64a32c88dd5f87621d391c0f10f6acef094073 (diff)
Properly generate diff of orphan commits, like the first commit in a repository
Diffstat (limited to 'lib/gitlab/diff')
-rw-r--r--lib/gitlab/diff/parser.rb5
1 files changed, 3 insertions, 2 deletions
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)