t4012: Break up pipe into serial redirections
authorAlexander Strasser <eclipse7@gmx.net>
Mon, 16 Jul 2012 20:44:30 +0000 (22:44 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Jul 2012 20:49:58 +0000 (13:49 -0700)
Do not hide possible git errors by masking its process
exit status.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4012-diff-binary.sh
index 60c2f6c36f942c75cd1c9a4f775cc2d37355b13e..daf82346141120194c448edbc9571a8e1da99b52 100755 (executable)
@@ -64,7 +64,8 @@ test_expect_success 'apply --numstat understands diff --binary format' '
 # apply needs to be able to skip the binary material correctly
 # in order to report the line number of a corrupt patch.
 test_expect_success 'apply detecting corrupt patch correctly' '
 # apply needs to be able to skip the binary material correctly
 # in order to report the line number of a corrupt patch.
 test_expect_success 'apply detecting corrupt patch correctly' '
-        git diff | sed -e "s/-CIT/xCIT/" >broken &&
+        git diff >output &&
+        sed -e "s/-CIT/xCIT/" <output >broken &&
         if git apply --stat --summary broken 2>detected
         then
                echo unhappy - should have detected an error
         if git apply --stat --summary broken 2>detected
         then
                echo unhappy - should have detected an error