summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPat Thoyts <patthoyts@users.sourceforge.net>2009-09-15 09:26:30 (GMT)
committerPaul Mackerras <paulus@samba.org>2009-09-21 03:04:48 (GMT)
commit9bedb0e185332f9f8fb5e1c18bb5aff9964145a6 (patch)
treeca20781e00ed3dd67f41d4384d7995ad430c52a4
parentc21398be6d7b112fa3a041b4b7d869d9954bf753 (diff)
downloadgit-9bedb0e185332f9f8fb5e1c18bb5aff9964145a6.zip
git-9bedb0e185332f9f8fb5e1c18bb5aff9964145a6.tar.gz
git-9bedb0e185332f9f8fb5e1c18bb5aff9964145a6.tar.bz2
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 <patthoyts@users.sourceforge.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk1
1 files changed, 1 insertions, 0 deletions
diff --git a/gitk b/gitk
index 1306178..a0214b7 100755
--- a/gitk
+++ b/gitk
@@ -2526,6 +2526,7 @@ proc savestuff {w} {
if {$stuffsaved} return
if {![winfo viewable .]} return
catch {
+ if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
set f [open "~/.gitk-new" w]
if {$::tcl_platform(platform) eq {windows}} {
file attributes "~/.gitk-new" -hidden true