git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-prompt: changes == to = for zsh's sake
@ 2020-07-20 23:17 David J. Malan via GitGitGadget
  2020-07-20 23:58 ` Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David J. Malan via GitGitGadget @ 2020-07-20 23:17 UTC (permalink / raw)
  To: git; +Cc: Elijah Newren, Junio C Hamano, David J. Malan, David J. Malan

From: "David J. Malan" <malan@harvard.edu>

When using git-prompt.sh with Zsh, __git_ps1 currently errs
when inside a repo with:

__git_ps1:96: = not found

This commit changes `==` to `=` for both Bash and Zsh.

Signed-off-by: David J. Malan <malan@harvard.edu>
---
    Changes == to = for zsh's sake in git-prompt.sh
    
    Upon installing git-prompt.sh
    [https://github.com/gitgitgadget/git/blob/master/contrib/completion/git-prompt.sh] 
    on macOS Catalina, I noticed that 
    https://github.com/gitgitgadget/git/commit/afda36dbf3b4f5a489ab44c00d5210c1fa894a40 
    seems to have introduced an issue for Zsh whereby __git_ps1 errs with
    
    __git_ps1:96: = not found
    
    when inside a repo. Changing == to = would seem to address for both Bash
    and Zsh.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-679%2Fdmalan%2Fpatch-1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-679/dmalan/patch-1-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/679

 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 e6cd5464e5..16260bab73 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
 

base-commit: ae46588be0cd730430dded4491246dfb4eac5557
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-21  0:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-20 23:17 [PATCH] git-prompt: changes == to = for zsh's sake David J. Malan via GitGitGadget
2020-07-20 23:58 ` Junio C Hamano
2020-07-21  0:40   ` Elijah Newren
2020-07-21  0:15 ` [PATCH v2] git-prompt: change " David J. Malan via GitGitGadget
2020-07-21  0:23 ` [PATCH] git-prompt: changes " Aaron Schrab
2020-07-21  0:40   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).