threads / patch / 49672

patchMove upstream status from gitstring to f

Subject: [PATCH] Move upstream status from gitstring to f

## tl;dr

One message between Oct 25, 2018 and Oct 25, 2018. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Khinshan Khan· Oct 25, 2018, 14:21 UTC · lore

Upstream status should be spaced even if other statuses don't exist for consistency of view. Eg: if a repository is freshly cloned, the prompt shows "(master=)" but with an additional status like a change, it'll show "(master *=)". Now it'll show "(master =)" and accounts for other states as well.

Signed-off-by: Khinshan Khan <khanshan501@gmail.com>
---
 contrib/completion/git-prompt.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-prompt.sh +2 −2
diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 983e419..4715d33 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -517,8 +517,8 @@ __git_ps1 ()
 		b="\${__git_ps1_branch_name}"
 	fi
 
-	local f="$w$i$s$u"
-	local gitstring="$c$b${f:+$z$f}$r$p"
+	local f="$w$i$s$u$p"
+	local gitstring="$c$b${f:+$z$f}$r"
 
 	if [ $pcmode = yes ]; then
 		if [ "${__git_printf_supports_v-}" != yes ]; then
-- 
2.7.4

← back to recent threads