aboutsummaryrefslogtreecommitdiffstats
path: root/git-gui.sh
diff options
context:
space:
mode:
authorOrgad Shaneh <orgads@gmail.com>2023-02-07 09:43:17 +0200
committerOrgad Shaneh <orgads@gmail.com>2024-06-30 09:15:04 +0300
commitf402c7941f19fa518e44b24bf31f3b6c3542c115 (patch)
tree740e00df6e2332955c05232295a7ef9e7e513971 /git-gui.sh
parentc1db9880936d752d8c2f56ab1aae01dd247de5d9 (diff)
downloadgit-f402c7941f19fa518e44b24bf31f3b6c3542c115.tar.gz
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>
Diffstat (limited to 'git-gui.sh')
-rwxr-xr-xgit-gui.sh2
1 files changed, 1 insertions, 1 deletions
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]]