Depending on whether other changes were present or displayed in PS1, the prompt may have lacked a space between the branch and the upstream marker. Add this space as needed so the branch name and upstream state aren't confusingly mixed.
Signed-off-by: Todd Zullinger <tmz@pobox.com> --- contrib/completion/git-completion.bash | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to contrib/completion/git-completion.bash +1 −0
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 0b0b913..e5af5f6 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -312,6 +312,7 @@ __git_ps1 () fi local f="$w$i$s$u" + [[ -z $f ]] && p="${p:+ $p}" printf "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p" fi }
--
1.7.4.1
--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Giving money and power to government is like giving whiskey and car
keys to teenage boys.
-- P.J. O'Rourke