]> git.ipfire.org Git - thirdparty/git.git/commit
git-prompt: fix expansion of branch colour codes
authorJoakim Petersen <joak-pet@online.no>
Fri, 10 Jun 2022 00:47:37 +0000 (02:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Jun 2022 16:41:49 +0000 (09:41 -0700)
commit0e5d9ef395467619b621540a7fdefbfc8062f2ac
treeedee32c9959ccfbeedb3118f60050ade9aa2dade
parent9470605a1b03dac8fc4f801132e36964b4fbb8c3
git-prompt: fix expansion of branch colour codes

Because of the wrapping of the branch name variable $b, the colour codes
in the variable don't get applied, but are instead printed directly in
the output. Move the wrapping of $b to before colour codes are inserted
to correct this. Revert move of branch name colour codes in tests, as
the branch name is now coloured after the wrapping instead of before.

Signed-off-by: Joakim Petersen <joak-pet@online.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-prompt.sh
t/t9903-bash-prompt.sh