summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-02-09 18:06:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-10 21:42:29 (GMT)
commit33f0ea42e12d3f54ef8ff53580649885c1503d05 (patch)
treed44d626ccf1518136835a816c917f4a699dad23c /t
parent92f9e273e86d505e4c2a28bc053eb514ca2cc552 (diff)
downloadgit-33f0ea42e12d3f54ef8ff53580649885c1503d05.zip
git-33f0ea42e12d3f54ef8ff53580649885c1503d05.tar.gz
git-33f0ea42e12d3f54ef8ff53580649885c1503d05.tar.bz2
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>
Diffstat (limited to 't')
-rwxr-xr-xt/t8003-blame.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t8003-blame.sh b/t/t8003-blame.sh
index 4a8db74..3bbddd0 100755
--- a/t/t8003-blame.sh
+++ b/t/t8003-blame.sh
@@ -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