From a3e9f544554761be4744685d2cf498b7110bc0fb Mon Sep 17 00:00:00 2001 From: Andrew Coleman Date: Mon, 16 Aug 2021 12:46:25 -0400 Subject: [PATCH] update git-prompt.sh --- private_dot_bashrc.d/git-prompt.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/private_dot_bashrc.d/git-prompt.sh b/private_dot_bashrc.d/git-prompt.sh index 4640a15..db7c006 100644 --- a/private_dot_bashrc.d/git-prompt.sh +++ b/private_dot_bashrc.d/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