Skip to content

Commit 929f577

Browse files
Martin von Zweigbergkpaulusmack
authored andcommitted
gitk: Put temporary directory inside .git
When running "External diff" from gitk, the "from" and "to" files will first be copied into a directory that is currently ".git/../.gitk-tmp.$pid". When gitk is closed, the directory is deleted. When the work tree is not at ".git/.." (which is supported since the previous commit), that directory may not even be git-related and it does not seem unlikely that permissions may not allow the temporary directory to be created there. Move the directory inside .git instead. This introduces a regression in the case that the .git directory is readonly, but .git/.. is writeable. Signed-off-by: Martin von Zweigbergk <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 784b7e2 commit 929f577

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gitk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,8 +3331,7 @@ proc gitknewtmpdir {} {
33313331
global diffnum gitktmpdir gitdir
33323332

33333333
if {![info exists gitktmpdir]} {
3334-
set gitktmpdir [file join [file dirname $gitdir] \
3335-
[format ".gitk-tmp.%s" [pid]]]
3334+
set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]]
33363335
if {[catch {file mkdir $gitktmpdir} err]} {
33373336
error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err"
33383337
unset gitktmpdir

0 commit comments

Comments
 (0)