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
This commit is contained in:
Junio C Hamano 2021-05-20 08:55:00 +09:00
Родитель 36a255acd1 5c0cbdb107
Коммит 02112fcb70
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -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