diff options
author | Jeff King <peff@peff.net> | 2015-03-20 06:09:00 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-03-20 10:20:15 -0700 |
commit | a167ece0c8cd9470427f8e9a1b43b27303eefa75 (patch) | |
tree | d302d080642c0655d2778ef32f82838df986aea4 /t/t7001-mv.sh | |
parent | 5ca812a19c97a2cbfe797748bc9bf6ebde9e0f64 (diff) | |
download | git-a167ece0c8cd9470427f8e9a1b43b27303eefa75.tar.gz |
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/t7001-mv.sh')
-rwxr-xr-x | t/t7001-mv.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index 69f11bd40d..7b56081137 100755 --- a/t/t7001-mv.sh +++ b/t/t7001-mv.sh @@ -161,10 +161,7 @@ test_expect_success "Michael Cassar's test case" ' git mv papers/unsorted/Thesis.pdf papers/all-papers/moo-blah.pdf && T=`git write-tree` && - git ls-tree -r $T | grep partA/outline.txt || { - git ls-tree -r $T - (exit 1) - } + git ls-tree -r $T | verbose grep partA/outline.txt ' rm -fr papers partA path? |