]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t9001, t9116: avoid pipes
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 14 Feb 2020 13:53:21 +0000 (13:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 14 Feb 2020 17:58:03 +0000 (09:58 -0800)
When grepping through the output of a command in the test suite, there
is always a chance that something goes wrong, in which case there would
not be anything useful to debug.

Let's redirect the output into a file instead, and grep that file, so
that the log can be inspected easily if the grep fails.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t9001-send-email.sh
t/t9116-git-svn-log.sh

index 997f90b42b3e513328b23f718ac7215eb9a960b8..7c5ef114ac906640b183cecc898d38513ae5f868 100755 (executable)
@@ -1194,8 +1194,8 @@ test_expect_success $PREREQ 'in-reply-to but no threading' '
                --to=nobody@example.com \
                --in-reply-to="<in-reply-id@example.com>" \
                --no-thread \
-               $patches |
-       grep "In-Reply-To: <in-reply-id@example.com>"
+               $patches >out &&
+       grep "In-Reply-To: <in-reply-id@example.com>" out
 '
 
 test_expect_success $PREREQ 'no in-reply-to and no threading' '
index 45773ee560dab10a6dbec4bf19a82bbdae3fe7c4..0a9f1ef366db07c31668f6bf4cf0d9267d788453 100755 (executable)
@@ -43,14 +43,18 @@ test_expect_success 'setup repository and import' '
 
 test_expect_success 'run log' "
        git reset --hard origin/a &&
-       git svn log -r2 origin/trunk | grep ^r2 &&
-       git svn log -r4 origin/trunk | grep ^r4 &&
-       git svn log -r3 | grep ^r3
+       git svn log -r2 origin/trunk >out &&
+       grep ^r2 out &&
+       git svn log -r4 origin/trunk >out &&
+       grep ^r4 out &&
+       git svn log -r3 >out &&
+       grep ^r3 out
        "
 
 test_expect_success 'run log against a from trunk' "
        git reset --hard origin/trunk &&
-       git svn log -r3 origin/a | grep ^r3
+       git svn log -r3 origin/a >out &&
+       grep ^r3 out
        "
 
 printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4