]> git.ipfire.org Git - thirdparty/git.git/commit
show-branch: don't <COLOR></RESET> for space characters
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 17 Jun 2021 10:53:37 +0000 (12:53 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 28 Jun 2021 16:33:06 +0000 (09:33 -0700)
commit4465690cd838017208d297a7f77d00ec51ccf7fd
treeb29d8151acaf639d85609480ce00815a9ea2b84a
parent9b6e74a9c0133c4e34f6ec56cc93a6a83eba2c3c
show-branch: don't <COLOR></RESET> for space characters

Change the colored output introduced in ab07ba2a24 (show-branch: color
the commit status signs, 2009-04-22) to not color and reset each
individual space character we use for padding. The intent is to color
just the "!", "+" etc. characters.

This makes the output easier to test, so let's do that now. The test
would be much more verbose without a color/reset for each space
character. Since the coloring cycles through colors we previously had
a "rainbow of space characters".

In theory this breaks things for anyone who's relying on the exact
colored output of show-branch, in practice I'd think anyone parsing it
isn't actively turning on the colored output.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/show-branch.c
t/t3202-show-branch.sh