aboutsummaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-06-17 17:08:35 +1000
committerPaul Mackerras <paulus@samba.org>2007-06-23 20:55:47 +1000
commit00609463979c3a2549c0c917a206345f51975b5d (patch)
tree1c8c0d1fe5bbb20ce5b3f6ee256c985f08d4976d /gitk
parent43c25074381dea404518318dacd360ed4f2abf3d (diff)
downloadgit-00609463979c3a2549c0c917a206345f51975b5d.tar.gz
git-00609463979c3a2549c0c917a206345f51975b5d.tar.xz
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>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk9
1 files changed, 8 insertions, 1 deletions
diff --git a/gitk b/gitk
index 0c2767df0..6a45fcae4 100755
--- a/gitk
+++ b/gitk
@@ -5502,10 +5502,16 @@ proc cherrypick {} {
# context menu for a head
proc headmenu {x y id head} {
- global headmenuid headmenuhead headctxmenu
+ global headmenuid headmenuhead headctxmenu mainhead
set headmenuid $id
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
}
@@ -5537,6 +5543,7 @@ proc rmbranch {} {
set head $headmenuhead
set id $headmenuid
+ # this check shouldn't be needed any more...
if {$head eq $mainhead} {
error_popup "Cannot delete the currently checked-out branch"
return