提交 97ed6857 编写于 作者: N Nguyễn Thái Ngọc Duy 提交者: Junio C Hamano

completion: disable dwim on "git switch -d"

Even though dwim is enabled by default, it will never be done when
--detached is specified. If you force "-d --guess" you will get an error
because --guess then implies -c which cannot be used with -d. So we can
disable dwim in "switch -d". It makes the completion list in this case a
bit shorter.
Signed-off-by: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 d16dc428
......@@ -2183,6 +2183,10 @@ _git_switch ()
fi
if [ -z "$(__git_find_on_cmdline "-d --detach")" ]; then
only_local_ref=y
else
# --guess --detach is invalid combination, no
# dwim will be done when --detach is specified
track_opt=
fi
if [ $only_local_ref = y -a -z "$track_opt" ]; then
__gitcomp_direct "$(__git_heads "" "$cur" " ")"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册