summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2013-09-18 02:52:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-09-18 05:16:22 (GMT)
commit8fc9f0227e8ea0461abfd3dc01cf1a51cca0f87f (patch)
treee6e11dcc8f9a04eacb83fb9ddf3526e9c1d15caf /contrib
parent3b30ba55e4c14c6939a201e87d3542e157e2b318 (diff)
downloadgit-8fc9f0227e8ea0461abfd3dc01cf1a51cca0f87f.zip
git-8fc9f0227e8ea0461abfd3dc01cf1a51cca0f87f.tar.gz
git-8fc9f0227e8ea0461abfd3dc01cf1a51cca0f87f.tar.bz2
contacts: fix to work in subdirectories
Unlike other git commands which work correctly at the top-level or in a subdirectory, git-contacts fails when invoked in a subdirectory. This is because it invokes git-blame with pathnames relative to the top-level, but git-blame interprets the pathnames as relative to the current directory. Fix this. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/contacts/git-contacts4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/contacts/git-contacts b/contrib/contacts/git-contacts
index fb6429b..428cc1a 100755
--- a/contrib/contacts/git-contacts
+++ b/contrib/contacts/git-contacts
@@ -181,6 +181,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);