Skip to content

Commit 8126b12

Browse files
peffgitster
authored andcommitted
t3205: use --color instead of color.branch=always
To test the color output, we must convince "git branch" to write colors to a non-terminal. We do that now by setting the color config to "always". In preparation for the behavior of "always" changing, let's switch to using the "--color" command-line option, which is more direct. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e10b381 commit 8126b12

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

t/t3205-branch-color.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ test_expect_success 'set up some sample branches' '
1212
# choose non-default colors to make sure config
1313
# is taking effect
1414
test_expect_success 'set up some color config' '
15-
git config color.branch always &&
1615
git config color.branch.local blue &&
1716
git config color.branch.remote yellow &&
1817
git config color.branch.current cyan
@@ -24,7 +23,7 @@ test_expect_success 'regular output shows colors' '
2423
<BLUE>other<RESET>
2524
<YELLOW>remotes/origin/master<RESET>
2625
EOF
27-
git branch -a >actual.raw &&
26+
git branch --color -a >actual.raw &&
2827
test_decode_color <actual.raw >actual &&
2928
test_cmp expect actual
3029
'
@@ -36,7 +35,7 @@ test_expect_success 'verbose output shows colors' '
3635
<BLUE>other <RESET> $oid foo
3736
<YELLOW>remotes/origin/master<RESET> $oid foo
3837
EOF
39-
git branch -v -a >actual.raw &&
38+
git branch --color -v -a >actual.raw &&
4039
test_decode_color <actual.raw >actual &&
4140
test_cmp expect actual
4241
'

0 commit comments

Comments
 (0)