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:
authorJeff King <peff@peff.net>2015-03-20 13:09:00 +0300
committerJunio C Hamano <gitster@pobox.com>2015-03-20 20:20:15 +0300
commita167ece0c8cd9470427f8e9a1b43b27303eefa75 (patch)
treed302d080642c0655d2778ef32f82838df986aea4 /t/t7300-clean.sh
parent5ca812a19c97a2cbfe797748bc9bf6ebde9e0f64 (diff)
t: use verbose instead of hand-rolled errors
Many tests that predate the "verbose" helper function use a pattern like: test ... || { echo ... false } to give more verbose output. Using the helper, we can do this with a single line, and avoid a || which interacts badly with &&-chaining (besides fooling --chain-lint, we hit the error block no matter which command in the chain failed, so we may often show useless results). In most cases, the messages printed by "verbose" are equally good (in some cases better; t6006 accidentally redirects the message to a file!). The exception is t7001, whose output suffers slightly. However, it's still enough to show the user which part failed, given that we will have just printed the test script to stderr. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7300-clean.sh')
-rwxr-xr-xt/t7300-clean.sh10
1 files changed, 2 insertions, 8 deletions
diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh
index 04118ad75b..99be5d95d0 100755
--- a/t/t7300-clean.sh
+++ b/t/t7300-clean.sh
@@ -119,10 +119,7 @@ test_expect_success C_LOCALE_OUTPUT 'git clean with relative prefix' '
git clean -n ../src |
sed -n -e "s|^Would remove ||p"
) &&
- test "$would_clean" = ../src/part3.c || {
- echo "OOps <$would_clean>"
- false
- }
+ verbose test "$would_clean" = ../src/part3.c
'
test_expect_success C_LOCALE_OUTPUT 'git clean with absolute path' '
@@ -134,10 +131,7 @@ test_expect_success C_LOCALE_OUTPUT 'git clean with absolute path' '
git clean -n "$(pwd)/../src" |
sed -n -e "s|^Would remove ||p"
) &&
- test "$would_clean" = ../src/part3.c || {
- echo "OOps <$would_clean>"
- false
- }
+ verbose test "$would_clean" = ../src/part3.c
'
test_expect_success 'git clean with out of work tree relative path' '