Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-21 13:10:04 +0300
committerJunio C Hamano <gitster@pobox.com>2018-04-24 04:38:47 +0300
commit8301266afa4a54ec3c27ac874017371b0a3178e1 (patch)
tree9f8eca70afa8d7cc730ba16efc1d8b09ee125ec8 /t/t5541-http-push-smart.sh
parent960786e7618942357c45e7e4c234f113e0aea9b1 (diff)
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>
Diffstat (limited to 't/t5541-http-push-smart.sh')
-rwxr-xr-xt/t5541-http-push-smart.sh12
1 files changed, 12 insertions, 0 deletions
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 <act >decoded &&
+ test_i18ngrep "<RED>.*rejected.*<RESET>" decoded &&
+ test_i18ngrep "<RED>error: failed to push some refs" decoded &&
+ test_i18ngrep "<YELLOW>hint: " decoded &&
+ test_i18ngrep ! "^hint: " decoded
+'
+
stop_httpd
test_done