From: Johannes Schindelin Date: Sat, 21 Apr 2018 10:10:04 +0000 (+0200) Subject: push: test to verify that push errors are colored X-Git-Tag: v2.18.0-rc0~76^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8301266afa4a54ec3c27ac874017371b0a3178e1?ds=inline;hp=--cc 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 Signed-off-by: Junio C Hamano --- 8301266afa4a54ec3c27ac874017371b0a3178e1 diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index 21340e89c9..a2af693068 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -377,5 +377,17 @@ test_expect_success 'push status output scrubs password' ' grep "^To $HTTPD_URL/smart/test_repo.git" status ' +test_expect_success 'colorize errors/hints' ' + cd "$ROOT_PATH"/test_repo_clone && + test_must_fail git -c color.transport=always -c color.advice=always \ + -c color.push=always \ + push origin origin/master^:master 2>act && + test_decode_color decoded && + test_i18ngrep ".*rejected.*" decoded && + test_i18ngrep "error: failed to push some refs" decoded && + test_i18ngrep "hint: " decoded && + test_i18ngrep ! "^hint: " decoded +' + stop_httpd test_done