mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
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>
This commit is contained in:
parent
3b30ba55e4
commit
8fc9f0227e
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue