提交 ca209065 编写于 作者: M Mark Lodato 提交者: Junio C Hamano

completion: fix zsh check under bash with 'set -u'

Commit 06f44c3c (completion: make compatible with zsh) broke bash
compatibility with 'set -u': a warning was generated when checking
$ZSH_VERSION.  The solution is to supply a default value, using
${ZSH_VERSION-}.  Thanks to SZEDER Gábor for the fix.
Signed-off-by: NMark Lodato <lodatom@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 7ebee441
......@@ -2345,7 +2345,7 @@ _git ()
{
local i c=1 command __git_dir
if [[ -n $ZSH_VERSION ]]; then
if [[ -n ${ZSH_VERSION-} ]]; then
emulate -L bash
setopt KSH_TYPESET
fi
......@@ -2394,7 +2394,7 @@ _git ()
_gitk ()
{
if [[ -n $ZSH_VERSION ]]; then
if [[ -n ${ZSH_VERSION-} ]]; then
emulate -L bash
setopt KSH_TYPESET
fi
......@@ -2434,7 +2434,7 @@ complete -o bashdefault -o default -o nospace -F _git git.exe 2>/dev/null \
|| complete -o default -o nospace -F _git git.exe
fi
if [[ -n $ZSH_VERSION ]]; then
if [[ -n ${ZSH_VERSION-} ]]; then
shopt () {
local option
if [ $# -ne 2 ]; then
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册