From f5402f151208679b542fa1ac74865beb9a3a7a09 Mon Sep 17 00:00:00 2001 From: "David J. Malan" Date: Sun, 19 Jul 2020 19:54:15 -0400 Subject: [PATCH] git-prompt: change == to = for zsh's sake When using git-prompt.sh with zsh, __git_ps1 currently errs when inside a repo with: __git_ps1:96: = not found Avoid using non-portable "==" that is only understood by bash and not zsh. Change to "=" so that the prompt script becomes usable with zsh again. Signed-off-by: David J. Malan --- contrib/completion/git-prompt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh index e6cd5464e5cad8..16260bab73346b 100644 --- a/contrib/completion/git-prompt.sh +++ b/contrib/completion/git-prompt.sh @@ -433,7 +433,7 @@ __git_ps1 () local sparse="" if [ -z "${GIT_PS1_COMPRESSSPARSESTATE}" ] && [ -z "${GIT_PS1_OMITSPARSESTATE}" ] && - [ "$(git config --bool core.sparseCheckout)" == "true" ]; then + [ "$(git config --bool core.sparseCheckout)" = "true" ]; then sparse="|SPARSE" fi @@ -542,7 +542,7 @@ __git_ps1 () fi if [ -n "${GIT_PS1_COMPRESSSPARSESTATE}" ] && - [ "$(git config --bool core.sparseCheckout)" == "true" ]; then + [ "$(git config --bool core.sparseCheckout)" = "true" ]; then h="?" fi