push: test to verify that push errors are colored
This actually only tests whether the push errors/hints are colored if the respective color.* config settings are `always`, but in the regular case they default to `auto` (in which case we color the messages when stderr is connected to an interactive terminal), therefore these tests should suffice. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Apr 21, 2018 at 12:10 UTC
8301266afa4a54ec3c27ac874017371b0a3178e1
1 file changed
+12
t/t5541-http-push-smart.sh
+12
@@ -377,5 +377,17 @@ test_expect_success 'push status output scrubs password' '
377
grep "^To $HTTPD_URL/smart/test_repo.git" status
378
'
379
380
+test_expect_success 'colorize errors/hints' '
381
+ cd "$ROOT_PATH"/test_repo_clone &&
382
+ test_must_fail git -c color.transport=always -c color.advice=always \
383
+ -c color.push=always \
384
+ push origin origin/master^:master 2>act &&
385
+ test_decode_color <act >decoded &&
386
+ test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
387
+ test_i18ngrep "<RED>error: failed to push some refs" decoded &&
388
+ test_i18ngrep "<YELLOW>hint: " decoded &&
389
+ test_i18ngrep ! "^hint: " decoded
390
+'
391
+
392
stop_httpd
393
test_done