t9001, t9116: avoid pipes
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>
Johannes Schindelin committed
Feb 14, 2020 at 13:53 UTC
de26f02db1b3296fc48e04755301171cf23062a0
2 files changed
+10
-6
t/t9001-send-email.sh
+2
-2
@@ -1194,8 +1194,8 @@ test_expect_success $PREREQ 'in-reply-to but no threading' '
1194
--to=nobody@example.com \
1195
--in-reply-to="<in-reply-id@example.com>" \
1196
--no-thread \
1197
- $patches |
1198
- grep "In-Reply-To: <in-reply-id@example.com>"
1197
+ $patches >out &&
1198
+ grep "In-Reply-To: <in-reply-id@example.com>" out
1199
'
1200
1201
test_expect_success $PREREQ 'no in-reply-to and no threading' '
t/t9116-git-svn-log.sh
+8
-4
@@ -43,14 +43,18 @@ test_expect_success 'setup repository and import' '
43
44
test_expect_success 'run log' "
45
git reset --hard origin/a &&
46
- git svn log -r2 origin/trunk | grep ^r2 &&
47
- git svn log -r4 origin/trunk | grep ^r4 &&
48
- git svn log -r3 | grep ^r3
46
+ git svn log -r2 origin/trunk >out &&
47
+ grep ^r2 out &&
48
+ git svn log -r4 origin/trunk >out &&
49
+ grep ^r4 out &&
50
+ git svn log -r3 >out &&
51
+ grep ^r3 out
52
"
53
54
test_expect_success 'run log against a from trunk' "
55
git reset --hard origin/trunk &&
53
- git svn log -r3 origin/a | grep ^r3
56
+ git svn log -r3 origin/a >out &&
57
+ grep ^r3 out
58
"
59
60
printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4