Skip to content

Commit c5bdfe6

Browse files
peffgitster
authored andcommitted
t6006: drop "always" color config tests
We test the %C() format placeholders with a variety of color-inducing options, including "--color" and "-c color.ui=always". In preparation for the behavior of "always" changing, we need to do something with those "always" tests. We can drop ones that expect "always" to turn on color even to a file, as that will become a synonym for "auto", which is already tested. For the "--no-color" test, we need to make sure that color would otherwise be shown. To do this, we can use test_terminal, which enables colors in the default setup. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0fcf760 commit c5bdfe6

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

t/t6006-rev-list-format.sh

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -208,26 +208,11 @@ do
208208
has_no_color actual
209209
'
210210

211-
test_expect_success "$desc enables colors for color.diff" '
212-
git -c color.diff=always log --format=$color -1 >actual &&
213-
has_color actual
214-
'
215-
216-
test_expect_success "$desc enables colors for color.ui" '
217-
git -c color.ui=always log --format=$color -1 >actual &&
218-
has_color actual
219-
'
220-
221211
test_expect_success "$desc respects --color" '
222212
git log --format=$color -1 --color >actual &&
223213
has_color actual
224214
'
225215

226-
test_expect_success "$desc respects --no-color" '
227-
git -c color.ui=always log --format=$color -1 --no-color >actual &&
228-
has_no_color actual
229-
'
230-
231216
test_expect_success TTY "$desc respects --color=auto (stdout is tty)" '
232217
test_terminal git log --format=$color -1 --color=auto >actual &&
233218
has_color actual
@@ -240,6 +225,11 @@ do
240225
has_no_color actual
241226
)
242227
'
228+
229+
test_expect_success TTY "$desc respects --no-color" '
230+
test_terminal git log --format=$color -1 --no-color >actual &&
231+
has_no_color actual
232+
'
243233
done
244234

245235
test_expect_success '%C(always,...) enables color even without tty' '

0 commit comments

Comments
 (0)