summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorMark Lodato <lodatom@gmail.com>2010-10-28 01:08:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-10-28 18:45:00 (GMT)
commitca209065f3cc3462eb0ae6090f6b13f38aa2114c (patch)
treece12954ca7304f23eaf091bc98b0127e9d75f1b7 /contrib/completion
parent7ebee44167fc25b975f5543472c851ab1840af1b (diff)
downloadgit-ca209065f3cc3462eb0ae6090f6b13f38aa2114c.zip
git-ca209065f3cc3462eb0ae6090f6b13f38aa2114c.tar.gz
git-ca209065f3cc3462eb0ae6090f6b13f38aa2114c.tar.bz2
completion: fix zsh check under bash with 'set -u'
Commit 06f44c3 (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: Mark Lodato <lodatom@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 64341d5..168669b 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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