diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-01-14 14:28:16 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-01-14 14:29:08 -0500 |
commit | 17d4b39806d147153d0bd864d2c23d4e6e6e08ef (patch) | |
tree | 1bd7e939edc524a9cbd86221e18bd129abc2b2f6 /lib | |
parent | 65eae647a6adb293dd761541d7fa5910a821e842 (diff) | |
parent | 6b000bee8cdc7005358c2a5cf3a1f12af57dc862 (diff) | |
download | gitlab-ce-17d4b39806d147153d0bd864d2c23d4e6e6e08ef.tar.gz |
Merge branch 'diff-parse-first-commit' into 'master'
Properly generate diff of orphan commits, like the first commit in a
repository
Fixes gitlab-org/gitlab_git#14
See merge request !2427
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/diff/parser.rb | 5 |
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) |