Skip to content

Commit

Permalink
gitk: Fix "show origin of this line" with separate work tree
Browse files Browse the repository at this point in the history
Running "show origin of this line" currently fails 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>
  • Loading branch information
Martin von Zweigbergk authored and Paul Mackerras committed Jul 24, 2011
1 parent c332f44 commit 9b6adf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -3589,7 +3589,7 @@ proc external_blame {parent_idx {line {}}} {
proc show_line_source {} {
global cmitmode currentid parents curview blamestuff blameinst
global diff_menu_line diff_menu_filebase flist_menu_file
global nullid nullid2 gitdir
global nullid nullid2 gitdir cdup

set from_index {}
if {$cmitmode eq "tree"} {
Expand Down Expand Up @@ -3642,7 +3642,7 @@ proc show_line_source {} {
} else {
lappend blameargs $id
}
lappend blameargs -- [file join [file dirname $gitdir] $flist_menu_file]
lappend blameargs -- [file join $cdup $flist_menu_file]
if {[catch {
set f [open $blameargs r]
} err]} {
Expand Down

0 comments on commit 9b6adf3

Please sign in to comment.