diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-05-20 08:55:00 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-05-20 08:55:00 +0900 |
commit | 02112fcb705c334311290e7699a6c0dca7585b8d (patch) | |
tree | 0ca9828dc8177d4537c82276aedf345988c0871f /contrib | |
parent | Merge branch 'zh/ref-filter-push-remote-fix' (diff) | |
parent | git-prompt: work under set -u (diff) | |
download | tgif-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.sh | 6 |
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 |