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>
Junio C Hamano committed
Feb 9, 2010 at 10:06 UTC
33f0ea42e12d3f54ef8ff53580649885c1503d05
1 file changed
+4
-2
t/t8003-blame.sh
+4
-2
@@ -158,11 +158,13 @@ EOF
158
'
159
160
test_expect_success 'blame -L with invalid start' '
161
- test_must_fail git blame -L5 tres 2>&1 | grep "has only 2 lines"
161
+ test_must_fail git blame -L5 tres 2>errors &&
162
+ grep "has only 2 lines" errors
163
'
164
165
test_expect_success 'blame -L with invalid end' '
165
- git blame -L1,5 tres 2>&1 | grep "has only 2 lines"
166
+ test_must_fail git blame -L1,5 tres 2>errors &&
167
+ grep "has only 2 lines" errors
168
'
169
170
test_done