From: Orgad Shaneh Date: Tue, 7 Feb 2023 07:43:17 +0000 (+0200) Subject: git-gui: fix inability to quit after closing another instance X-Git-Tag: v2.46.0-rc0~12^2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f402c7941f19fa518e44b24bf31f3b6c3542c115;p=thirdparty%2Fgit.git 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 --- diff --git a/git-gui.sh b/git-gui.sh index 507fb2b682..8fe7538e72 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2301,7 +2301,7 @@ proc do_quit {{rc {1}}} { # set save [gitdir GITGUI_MSG] if {$GITGUI_BCK_exists && ![$ui_comm edit modified]} { - file rename -force [gitdir GITGUI_BCK] $save + catch { file rename -force [gitdir GITGUI_BCK] $save } set GITGUI_BCK_exists 0 } elseif {[$ui_comm edit modified]} { set msg [string trim [$ui_comm get 0.0 end]]