Code

git-gui: Disable pull menu items when the index is locked.
authorShawn O. Pearce <spearce@spearce.org>
Wed, 8 Nov 2006 02:43:16 +0000 (21:43 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 8 Nov 2006 04:48:22 +0000 (23:48 -0500)
If we have the index locked then no pull command is allowed to proceed
(as it would fail to get the index lock itself).  So disable the pull
menu items when we are doing any index based operations.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui

diff --git a/git-gui b/git-gui
index 465c2f388b3ab0d8407fd28db0b80f768d4d080c..4041aaacd9ff6d82010b1344372192bfdcc3b04b 100755 (executable)
--- a/git-gui
+++ b/git-gui
@@ -932,7 +932,7 @@ proc populate_remote_menu {m pfx op} {
 }
 
 proc populate_pull_menu {m} {
-       global gitdir repo_config all_remotes mainfont
+       global gitdir repo_config all_remotes mainfont disable_on_lock
 
        foreach remote $all_remotes {
                set rb {}
@@ -961,6 +961,8 @@ proc populate_pull_menu {m} {
                                -label "Branch $rb_short from $remote..." \
                                -command [list pull_remote $remote $rb] \
                                -font $mainfont
+                       lappend disable_on_lock \
+                               [list $m entryconf [$m index last] -state]
                }
        }
 }