3 test_description
='basic branch output coloring'
6 test_expect_success
'set up some sample branches' '
9 git update-ref refs/remotes/origin/main HEAD &&
10 git update-ref refs/heads/other HEAD
13 # choose non-default colors to make sure config
15 test_expect_success
'set up some color config' '
16 git config color.branch.local blue &&
17 git config color.branch.remote yellow &&
18 git config color.branch.current cyan
21 test_expect_success
'regular output shows colors' '
22 cat >expect <<-\EOF &&
25 <YELLOW>remotes/origin/main<RESET>
27 git branch --color -a >actual.raw &&
28 test_decode_color <actual.raw >actual &&
29 test_cmp expect actual
32 test_expect_success
'verbose output shows colors' '
33 oid=$(git rev-parse --short HEAD) &&
35 * <CYAN>main <RESET> $oid foo
36 <BLUE>other <RESET> $oid foo
37 <YELLOW>remotes/origin/main<RESET> $oid foo
39 git branch --color -v -a >actual.raw &&
40 test_decode_color <actual.raw >actual &&
41 test_cmp expect actual