首先我输入git stash show
.
然后输入sand tab,它显示git stash show stash@{
,到目前为止它工作正常。
但是在我输入1and之后tab,它变成了git stash show stashstash@{1}
,而且很明显是错误的。
我认为.git-completion.bash中的以下代码可能有一些错误,但我几乎看不懂。
_git_stash ()
{
local save_opts='--keep-index --no-keep-index --quiet --patch'
local subcommands='save list show apply clear drop pop create branch'
local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then
case "$cur" in
--*)
__gitcomp "$save_opts"
;;
*)
if [ -z "$(__git_find_on_cmdline "$save_opts")" ]; then
__gitcomp "$subcommands"
else
COMPREPLY=()
fi
;;
esac
else
case "$subcommand,$cur" in
save,--*)
__gitcomp "$save_opts"
;;
apply,--*|pop,--*)
__gitcomp "--index --quiet"
;;
show,--*|drop,--*|branch,--*)
COMPREPLY=()
;;
show,*|apply,*|drop,*|pop,*|branch,*)
__gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
| sed -n -e 's/:.*//p')"
;;
*)
COMPREPLY=()
;;
esac
fi
}
有谁知道如何修理它?
Bash 版本:GNU bash,版本 4.2.37(2)-release (i386-apple-darwin12.0.0)。
git版本:1.8.0.3