summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Pat Thoyts <patthoyts@users.sourceforge.net>2013-06-15 23:36:27 +0100
committerLibravatar Pat Thoyts <patthoyts@users.sourceforge.net>2013-06-15 23:36:27 +0100
commit5c37033edf7963616038ff8b980047d5671e168e (patch)
treeb163e9f088f10dd83fb4cee25e2dfd647611b186
parentgit-gui: fix file name handling with non-empty prefix (diff)
downloadtgif-5c37033edf7963616038ff8b980047d5671e168e.tar.xz
git-gui: avoid an error message when removing the last remote
When the last remote is removed on a system that has tearoff menu items the code that adjusts the fetch and prune menus may raise an error when probing the menu entry for a non-existing -label option. Check the entry type to avoid this fault. Reported-by: Vedran Miletić <rivanvx@gmail.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rw-r--r--lib/remote.tcl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/remote.tcl b/lib/remote.tcl
index 5e4e7f4c83..4e5c784418 100644
--- a/lib/remote.tcl
+++ b/lib/remote.tcl
@@ -245,7 +245,8 @@ proc update_all_remotes_menu_entry {} {
set prune_m $remote_m.prune
if {$have_remote > 1} {
make_sure_remote_submenues_exist $remote_m
- if {[$fetch_m entrycget end -label] ne "All"} {
+ if {[$fetch_m type end] eq "command" \
+ && [$fetch_m entrycget end -label] ne "All"} {
$fetch_m insert end separator
$fetch_m insert end command \
@@ -259,7 +260,8 @@ proc update_all_remotes_menu_entry {} {
}
} else {
if {[winfo exists $fetch_m]} {
- if {[$fetch_m entrycget end -label] eq "All"} {
+ if {[$fetch_m type end] eq "command" \
+ && [$fetch_m entrycget end -label] eq "All"} {
delete_from_menu $fetch_m end
delete_from_menu $fetch_m end