git-contacts: do not fail parsing of good diffs
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 15 Feb 2014 17:24:50 +0000 (18:24 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2014 23:10:47 +0000 (15:10 -0800)
If a line in a patch starts with "--- " it will be deemed
malformed unless it also contains the proper diff header
format. This situation can happen with a valid patch if
it has a line starting with "-- " and that line is removed.

This patch just removes the check in git-contacts.

Signed-off-by: Lars Gullik Bjønnes <larsbj@gullik.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/contacts/git-contacts
index 428cc1a9a1367e36c2739cb226a0ffdd2704ce82..dbe2abf27730e20fcbd692012e9dd07a2e70404f 100755 (executable)
@@ -96,8 +96,6 @@ sub scan_patches {
                next unless $id;
                if (m{^--- (?:a/(.+)|/dev/null)$}) {
                        $source = $1;
-               } elsif (/^--- /) {
-                       die "Cannot parse hunk source: $_\n";
                } elsif (/^@@ -(\d+)(?:,(\d+))?/ && $source) {
                        my $len = defined($2) ? $2 : 1;
                        push @{$sources->{$source}{$id}}, [$1, $len] if $len;