summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-05-20 08:55:00 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-05-20 08:55:00 +0900
commit02112fcb705c334311290e7699a6c0dca7585b8d (patch)
tree0ca9828dc8177d4537c82276aedf345988c0871f /contrib
parentMerge branch 'zh/ref-filter-push-remote-fix' (diff)
parentgit-prompt: work under set -u (diff)
downloadtgif-02112fcb705c334311290e7699a6c0dca7585b8d.tar.xz
Merge branch 'en/prompt-under-set-u'
The bash prompt script (in contrib/) did not work under "set -u". * en/prompt-under-set-u: git-prompt: work under set -u
Diffstat (limited to 'contrib')
-rw-r--r--contrib/completion/git-prompt.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 4640a1535d..db7c0068fb 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -433,8 +433,8 @@ __git_ps1 ()
fi
local sparse=""
- if [ -z "${GIT_PS1_COMPRESSSPARSESTATE}" ] &&
- [ -z "${GIT_PS1_OMITSPARSESTATE}" ] &&
+ if [ -z "${GIT_PS1_COMPRESSSPARSESTATE-}" ] &&
+ [ -z "${GIT_PS1_OMITSPARSESTATE-}" ] &&
[ "$(git config --bool core.sparseCheckout)" = "true" ]; then
sparse="|SPARSE"
fi
@@ -543,7 +543,7 @@ __git_ps1 ()
u="%${ZSH_VERSION+%}"
fi
- if [ -n "${GIT_PS1_COMPRESSSPARSESTATE}" ] &&
+ if [ -n "${GIT_PS1_COMPRESSSPARSESTATE-}" ] &&
[ "$(git config --bool core.sparseCheckout)" = "true" ]; then
h="?"
fi