]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-prompt: change == to = for zsh's sake
authorDavid J. Malan <malan@harvard.edu>
Tue, 21 Jul 2020 00:15:31 +0000 (00:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Jul 2020 00:37:20 +0000 (17:37 -0700)
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>
contrib/completion/git-prompt.sh

index e6cd5464e5cad86f92deddea111dae8744b159aa..16260bab73346ba79d8e96eda03628d7dbd4b75b 100644 (file)
@@ -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