Skip to content

Commit 9bedb0e

Browse files
patthoytspaulusmack
authored andcommitted
gitk: Work around leftover temporary save file
If a file exists and is hidden on Windows the Tcl open command will fail as the attributes provided in the CREAT call fail to match those of the existing file. Forcing removal of the temporary file before we begin solves any problems caused by previous failures to save the application settings. An alternative would be to remove the hidden attribute before calling 'open'. Signed-off-by: Pat Thoyts <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent c21398b commit 9bedb0e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gitk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,6 +2526,7 @@ proc savestuff {w} {
25262526
if {$stuffsaved} return
25272527
if {![winfo viewable .]} return
25282528
catch {
2529+
if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
25292530
set f [open "~/.gitk-new" w]
25302531
if {$::tcl_platform(platform) eq {windows}} {
25312532
file attributes "~/.gitk-new" -hidden true

0 commit comments

Comments
 (0)