git-gui: fetch/prune all entry only for more than one entry
authorHeiko Voigt <hvoigt@hvoigt.net>
Tue, 22 Feb 2011 19:28:36 +0000 (20:28 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 24 Feb 2011 00:11:45 +0000 (00:11 +0000)
In case there is only one remote a fetch/prune all entry
is redundant.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Tested-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/remote.tcl

index 42d20614023b3827c420f177b1d62be70809e052..18d3d065854f99d4e7ebb3ea1d765d0b0f79b609 100644 (file)
@@ -237,13 +237,13 @@ proc update_all_remotes_menu_entry {} {
 
        set have_remote 0
        foreach r $all_remotes {
-               set have_remote 1
+               incr have_remote
        }
 
        set remote_m .mbar.remote
        set fetch_m $remote_m.fetch
        set prune_m $remote_m.prune
-       if {$have_remote} {
+       if {$have_remote > 1} {
                make_sure_remote_submenues_exist $remote_m
                set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
                if {[$fetch_m entrycget $index -label] ne "All"} {