Merge branch 'jk/clean-d-pathspec'
[gitweb.git] / contrib / contacts / git-contacts
index fb6429b64be3cf7011ce69950987a8b328e0e758..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;
@@ -181,6 +179,10 @@ if (@rev_args) {
        scan_rev_args(\%sources, \@rev_args)
 }
 
+my $toplevel = `git rev-parse --show-toplevel`;
+chomp $toplevel;
+chdir($toplevel) or die "chdir failure: $toplevel: $!\n";
+
 my %commits;
 blame_sources(\%sources, \%commits);
 import_commits(\%commits);