@matheusbsbs / matheus-bagliano / commits / e8882a87d9
Fork 0

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 <malan@harvard.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David J. Malan committed Jul 21, 2020 at 00:15 UTC e8882a87d9c479fd9d6e71a5840e949579304ab9
1 file changed +2 -2
contrib/completion/git-prompt.sh
+2 -2
@@ -433,7 +433,7 @@ __git_ps1 ()
433 local sparse=""
434 if [ -z "${GIT_PS1_COMPRESSSPARSESTATE}" ] &&
435 [ -z "${GIT_PS1_OMITSPARSESTATE}" ] &&
436 - [ "$(git config --bool core.sparseCheckout)" == "true" ]; then
436 + [ "$(git config --bool core.sparseCheckout)" = "true" ]; then
437 sparse="|SPARSE"
438 fi
439
@@ -542,7 +542,7 @@ __git_ps1 ()
542 fi
543
544 if [ -n "${GIT_PS1_COMPRESSSPARSESTATE}" ] &&
545 - [ "$(git config --bool core.sparseCheckout)" == "true" ]; then
545 + [ "$(git config --bool core.sparseCheckout)" = "true" ]; then
546 h="?"
547 fi
548