Skip to content

Commit f402c79

Browse files
committed
git-gui: fix inability to quit after closing another instance
If you open 2 git gui instances in the same directory, then close one of them and try to close the other, an error message pops up, saying: 'error renaming ".git/GITGUI_BCK": no such file or directory', and it is no longer possible to close the window ever. Fix by catching this error, and proceeding even if the file no longer exists. Signed-off-by: Orgad Shaneh <[email protected]>
1 parent c1db988 commit f402c79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-gui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,7 @@ proc do_quit {{rc {1}}} {
23012301
#
23022302
set save [gitdir GITGUI_MSG]
23032303
if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} {
2304-
file rename -force [gitdir GITGUI_BCK] $save
2304+
catch { file rename -force [gitdir GITGUI_BCK] $save }
23052305
set GITGUI_BCK_exists 0
23062306
} elseif {[$ui_comm edit modified]} {
23072307
set msg [string trim [$ui_comm get 0.0 end]]

0 commit comments

Comments
 (0)