Skip to content

Commit 1bf7528

Browse files
committed
Merge pull request dmnd#1 from uu1101/patch-1
Allow running the script from any subdirectory
2 parents 44e119a + d193390 commit 1bf7528

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-diff-blame

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ sub get_blame_prefix {
1515
return $1;
1616
}
1717

18+
$git_root = `git rev-parse --show-toplevel`;
19+
$git_root =~ s/^\s+//;
20+
$git_root =~ s/\s+$//;
21+
chdir($git_root) or die "$!";
22+
1823
my ($oldrev, $newrev) = @ARGV;
1924
$oldrev ||= 'HEAD';
2025
if ($newrev) {

0 commit comments

Comments
 (0)