path: root/t
diff options
authorJeff King <>2017-10-03 13:45:47 (GMT)
committerJunio C Hamano <>2017-10-04 02:35:29 (GMT)
commit0c88bf50502e2be7d7d8965052d77bbf08e1d519 (patch)
tree2e0526a67f059be8fce0eaac254232845bdb9544 /t
parent8126b1267c9b3c8cdc79daf56492972b82f0a57d (diff)
provide --color option for all ref-filter users
When ref-filter learned about want_color() in 11b087adfd (ref-filter: consult want_color() before emitting colors, 2017-07-13), it became useful to be able to turn colors off and on for specific commands. For git-branch, you can do so with --color/--no-color. But for git-for-each-ref and git-tag, the other users of ref-filter, you have no option except to tweak the "color.ui" config setting. Let's give both of these commands the usual color command-line options. This is a bit more obvious as a method for overriding the config. And it also prepares us for the behavior of "always" changing (so that we are still left with a way of forcing color when our output goes to a non-terminal). Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't')
2 files changed, 4 insertions, 4 deletions
diff --git a/t/ b/t/
index d6bffe6..6358134 100755
--- a/t/
+++ b/t/
@@ -435,8 +435,8 @@ test_expect_success '%(color) does not show color without tty' '
test_cmp expected.bare actual
-test_expect_success 'color.ui=always can override tty check' '
- git -c color.ui=always for-each-ref --format="$color_format" >actual.raw &&
+test_expect_success '--color can override tty check' '
+ git for-each-ref --color --format="$color_format" >actual.raw &&
test_decode_color <actual.raw >actual &&
test_cmp expected.color actual
diff --git a/t/ b/t/
index 6dc4447..f554737 100755
--- a/t/
+++ b/t/
@@ -1919,8 +1919,8 @@ test_expect_success TTY '%(color) present with tty' '
test_cmp expect.color actual
-test_expect_success 'color.ui=always overrides auto-color' '
- git -c color.ui=always tag $color_args >actual.raw &&
+test_expect_success '--color overrides auto-color' '
+ git tag --color $color_args >actual.raw &&
test_decode_color <actual.raw >actual &&
test_cmp expect.color actual