summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 69e21b8)
raw | patch | inline | side by side (parent: 69e21b8)
author | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Tue, 15 Feb 2011 00:20:36 +0000 (00:20 +0000) | ||
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | |
Tue, 15 Feb 2011 00:20:36 +0000 (00:20 +0000) |
The --all option for git fetch was added in v1.6.6 so ensure we have a usable version before adding
the menu items.
Sometimes people use tearoff menus and these offset the entry indices by one.
Acked-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
the menu items.
Sometimes people use tearoff menus and these offset the entry indices by one.
Acked-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/remote.tcl | patch | blob | history |
diff --git a/lib/remote.tcl b/lib/remote.tcl
index 817ca1b6a3b5cb2ee2616d60cbaaa263387c4906..42d20614023b3827c420f177b1d62be70809e052 100644 (file)
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
proc update_all_remotes_menu_entry {} {
global all_remotes
+ if {[git-version < 1.6.6]} { return }
+
set have_remote 0
foreach r $all_remotes {
set have_remote 1
set prune_m $remote_m.prune
if {$have_remote} {
make_sure_remote_submenues_exist $remote_m
- if {[$fetch_m entrycget 0 -label] ne "All"} {
+ set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
+ if {[$fetch_m entrycget $index -label] ne "All"} {
- $fetch_m insert 0 separator
- $fetch_m insert 0 command \
+ $fetch_m insert $index separator
+ $fetch_m insert $index command \
-label "All" \
-command fetch_from_all
- $prune_m insert 0 separator
- $prune_m insert 0 command \
- -label "All" \
+ $prune_m insert $index separator
+ $prune_m insert $index command \
+ -label "All" \
-command prune_from_all
}
} else {
if {[winfo exists $fetch_m]} {
+ set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
if {[$fetch_m type end] eq "separator"} {
- delete_from_menu $fetch_m 0
- delete_from_menu $fetch_m 0
+ delete_from_menu $fetch_m $index
+ delete_from_menu $fetch_m $index
- delete_from_menu $prune_m 0
- delete_from_menu $prune_m 0
+ delete_from_menu $prune_m $index
+ delete_from_menu $prune_m $index
}
}
}