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 <orgads@gmail.com>

Orgad Shaneh committed Feb 7, 2023 at 09:43 UTC f402c7941f19fa518e44b24bf31f3b6c3542c115
1 file changed +1 -1
git-gui.sh
+1 -1
@@ -2301,7 +2301,7 @@ proc do_quit {{rc {1}}} {
2301 #
2302 set save [gitdir GITGUI_MSG]
2303 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 }
2305 set GITGUI_BCK_exists 0
2306 } elseif {[$ui_comm edit modified]} {
2307 set msg [string trim [$ui_comm get 0.0 end]]