Skip to content

Commit e8882a8

Browse files
dmalangitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent afda36d commit e8882a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/completion/git-prompt.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ __git_ps1 ()
433433
local sparse=""
434434
if [ -z "${GIT_PS1_COMPRESSSPARSESTATE}" ] &&
435435
[ -z "${GIT_PS1_OMITSPARSESTATE}" ] &&
436-
[ "$(git config --bool core.sparseCheckout)" == "true" ]; then
436+
[ "$(git config --bool core.sparseCheckout)" = "true" ]; then
437437
sparse="|SPARSE"
438438
fi
439439

@@ -542,7 +542,7 @@ __git_ps1 ()
542542
fi
543543

544544
if [ -n "${GIT_PS1_COMPRESSSPARSESTATE}" ] &&
545-
[ "$(git config --bool core.sparseCheckout)" == "true" ]; then
545+
[ "$(git config --bool core.sparseCheckout)" = "true" ]; then
546546
h="?"
547547
fi
548548

0 commit comments

Comments
 (0)