t8003: check exit code of command and error message separately

Shell reports exit status only from the most downstream command
in a pipeline.  In these tests, we want to make sure that the
command fails in a controlled way, and produces a correct error
message.

This issue was known by Jay who submitted the patch, and also was
pointed out by Hannes during the review process, but I forgot to
fix it up before applying.  Sorry about that.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2010-02-09 10:06:33 -08:00
parent 92f9e273e8
commit 33f0ea42e1

View file

@ -158,11 +158,13 @@ EOF
'
test_expect_success 'blame -L with invalid start' '
test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines"
test_must_fail git blame -L5 tres 2>errors &&
grep "has only 2 lines" errors
'
test_expect_success 'blame -L with invalid end' '
git blame -L1,5 tres 2>&1 | grep "has only 2 lines"
test_must_fail git blame -L1,5 tres 2>errors &&
grep "has only 2 lines" errors
'
test_done