提交 da12e59d 编写于 作者: J Johannes Sixt 提交者: Paul Mackerras

gitk: Ensure that "Reset branch" menu entry is enabled

Consider this sequence of events:

1. Detach HEAD and fire up gitk
2. Call the context menu on some commit. Notice that the last menu entry
   says "Detached HEAD: can't reset" and it is disabled.
3. Now checkout some regular branch (e.g. 'master') using the context menu.
4. Call the context menu again on some commit.

Previously, at this point the last menu entry said "Reset master branch
to here", but it was still disabled. With this fix it is now enabled again.
Signed-off-by: NJohannes Sixt <j6t@kdbg.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 adcbec13
......@@ -7979,7 +7979,7 @@ proc rowmenu {x y id} {
if {$id ne $nullid && $id ne $nullid2} {
set menu $rowctxmenu
if {$mainhead ne {}} {
$menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead]
$menu entryconfigure 7 -label [mc "Reset %s branch to here" $mainhead] -state normal
} else {
$menu entryconfigure 7 -label [mc "Detached head: can't reset" $mainhead] -state disabled
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册