gitk: Fix "blame parent commit" with separate work tree
Running "blame parent commit" currently brings up an empty blame view when the the work tree is not the parent of the git directory. Fix it by feeding git-blame paths relative to $GIT_WORK_TREE instead of "$GIT_DIR/..". Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Martin von Zweigbergk committed
Apr 4, 2011 at 22:14 UTC
0a2a979310c1ebc43d460fd8564981c9b3b99f07
1 file changed
+2
-2
gitk
+2
-2
@@ -3557,7 +3557,7 @@ proc make_relative {f} {
3557
}
3558
3559
proc external_blame {parent_idx {line {}}} {
3560
- global flist_menu_file gitdir
3560
+ global flist_menu_file cdup
3561
global nullid nullid2
3562
global parentlist selectedline currentid
3563
@@ -3576,7 +3576,7 @@ proc external_blame {parent_idx {line {}}} {
3576
if {$line ne {} && $line > 1} {
3577
lappend cmdline "--line=$line"
3578
}
3579
- set f [file join [file dirname $gitdir] $flist_menu_file]
3579
+ set f [file join $cdup $flist_menu_file]
3580
# Unfortunately it seems git gui blame doesn't like
3581
# being given an absolute path...
3582
set f [make_relative $f]