gitk: Disable the head context menu entries for the checked-out branch
Neither the "check out this branch" nor the "remove this branch" menu item can be used on the currently-checked out branch, so disable them. Signed-off-by: Paul Mackerras <paulus@samba.org>maint
parent
43c2507438
commit
0060946397
9
gitk
9
gitk
|
@ -5502,10 +5502,16 @@ proc cherrypick {} {
|
||||||
|
|
||||||
# context menu for a head
|
# context menu for a head
|
||||||
proc headmenu {x y id head} {
|
proc headmenu {x y id head} {
|
||||||
global headmenuid headmenuhead headctxmenu
|
global headmenuid headmenuhead headctxmenu mainhead
|
||||||
|
|
||||||
set headmenuid $id
|
set headmenuid $id
|
||||||
set headmenuhead $head
|
set headmenuhead $head
|
||||||
|
set state normal
|
||||||
|
if {$head eq $mainhead} {
|
||||||
|
set state disabled
|
||||||
|
}
|
||||||
|
$headctxmenu entryconfigure 0 -state $state
|
||||||
|
$headctxmenu entryconfigure 1 -state $state
|
||||||
tk_popup $headctxmenu $x $y
|
tk_popup $headctxmenu $x $y
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5537,6 +5543,7 @@ proc rmbranch {} {
|
||||||
|
|
||||||
set head $headmenuhead
|
set head $headmenuhead
|
||||||
set id $headmenuid
|
set id $headmenuid
|
||||||
|
# this check shouldn't be needed any more...
|
||||||
if {$head eq $mainhead} {
|
if {$head eq $mainhead} {
|
||||||
error_popup "Cannot delete the currently checked-out branch"
|
error_popup "Cannot delete the currently checked-out branch"
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue