OSDN Git Service

t3205: use --color instead of color.branch=always
authorJeff King <peff@peff.net>
Tue, 3 Oct 2017 13:45:18 +0000 (09:45 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Oct 2017 02:34:15 +0000 (11:34 +0900)
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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3205-branch-color.sh

index 9343550..4f1e16b 100755 (executable)
@@ -12,7 +12,6 @@ test_expect_success 'set up some sample branches' '
 # choose non-default colors to make sure config
 # is taking effect
 test_expect_success 'set up some color config' '
-       git config color.branch always &&
        git config color.branch.local blue &&
        git config color.branch.remote yellow &&
        git config color.branch.current cyan
@@ -24,7 +23,7 @@ test_expect_success 'regular output shows colors' '
          <BLUE>other<RESET>
          <YELLOW>remotes/origin/master<RESET>
        EOF
-       git branch -a >actual.raw &&
+       git branch --color -a >actual.raw &&
        test_decode_color <actual.raw >actual &&
        test_cmp expect actual
 '
@@ -36,7 +35,7 @@ test_expect_success 'verbose output shows colors' '
          <BLUE>other                <RESET> $oid foo
          <YELLOW>remotes/origin/master<RESET> $oid foo
        EOF
-       git branch -v -a >actual.raw &&
+       git branch --color -v -a >actual.raw &&
        test_decode_color <actual.raw >actual &&
        test_cmp expect actual
 '