summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>2011-04-05 02:14:15 (GMT)
committerPaul Mackerras <paulus@samba.org>2011-07-24 05:34:54 (GMT)
commit784b7e2f25ce2a812d6b2dcbe4d3a2ea93484bb4 (patch)
tree987ec8f6f23aacb744ab91d34f55fcc75d783081 /gitk
parent0a2a979310c1ebc43d460fd8564981c9b3b99f07 (diff)
downloadgit-784b7e2f25ce2a812d6b2dcbe4d3a2ea93484bb4.zip
git-784b7e2f25ce2a812d6b2dcbe4d3a2ea93484bb4.tar.gz
git-784b7e2f25ce2a812d6b2dcbe4d3a2ea93484bb4.tar.bz2
gitk: Fix "External diff" with separate work tree
Running "External diff" to compare the index and work tree currently brings up an empty blame view when the work tree is not the parent of the git directory. This is because the file that is taken from the work tree is assumed to be in $GIT_DIR/../<repo-relative-file-name>. Fix it by feeding the diff tool a path under $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>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk5
1 files changed, 3 insertions, 2 deletions
diff --git a/gitk b/gitk
index 8626467..5d15005 100755
--- a/gitk
+++ b/gitk
@@ -3364,10 +3364,10 @@ proc save_file_from_commit {filename output what} {
proc external_diff_get_one_file {diffid filename diffdir} {
global nullid nullid2 nullfile
- global gitdir
+ global worktree
if {$diffid == $nullid} {
- set difffile [file join [file dirname $gitdir] $filename]
+ set difffile [file join $worktree $filename]
if {[file exists $difffile]} {
return $difffile
}
@@ -11650,6 +11650,7 @@ set cdup {}
if {$isworktree} {
set cdup [exec git rev-parse --show-cdup]
}
+set worktree [exec git rev-parse --show-toplevel]
setcoords
makewindow
catch {