aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Ballabio <barra_cuda@katamail.com>2008-05-02 17:46:20 +0200
committerPaul Mackerras <paulus@samba.org>2008-05-03 17:57:35 +1000
commit5e3502dabb6e95e3d9420e010276f832cb68e396 (patch)
tree521d3ad1d847879dc443e07a14677a4521766eba
parent81811a74ba48ee4ab88aa98d6e72f499eefec819 (diff)
downloadgit-5e3502dabb6e95e3d9420e010276f832cb68e396.tar.gz
git-5e3502dabb6e95e3d9420e010276f832cb68e396.tar.xz
gitk: Disable "Reset %s branch to here" when on a detached head
When we are on a detached head - since gitk does not display where we are - reset has no sense, so disable the relevant line on the context menu, and point out to the user that we are on a detached head. Otherwise, a reset from gitk when on a detached head returns the error: can't read "headids()": no such element in array can't read "headids()": no such element in array while executing "removehead $headids($name) $name" (procedure "movehead" line 4) invoked from within "movehead $newhead $mainhead" (procedure "readresetstat" line 20) invoked from within "readresetstat file4" ("eval" body line 1) invoked from within "eval $script" (procedure "dorunq" line 9) invoked from within "dorunq" ("after" script) [paulus@samba.org: changed menu item to "Detached head: can't reset"] Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rwxr-xr-xgitk6
1 files changed, 5 insertions, 1 deletions
diff --git a/gitk b/gitk
index da685aa63..9e282e58e 100755
--- a/gitk
+++ b/gitk
@@ -6016,7 +6016,11 @@ proc rowmenu {x y id} {
}
if {$id ne $nullid && $id ne $nullid2} {
set menu $rowctxmenu
- $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead]
+ if {$mainhead ne {}} {
+ $menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead]
+ } else {
+ $menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled
+ }
} else {
set menu $fakerowmenu
}