Skip to content

Commit

Permalink
git-gui: avoid an error message when removing the last remote
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pat Thoyts committed Jun 15, 2013
1 parent 2f38dd0 commit 5c37033
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/remote.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down

0 comments on commit 5c37033

Please sign in to comment.