Skip to content

Commit de26f02

Browse files
dschogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b6d4d82 commit de26f02

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

t/t9001-send-email.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,8 +1194,8 @@ test_expect_success $PREREQ 'in-reply-to but no threading' '
11941194
11951195
--in-reply-to="<[email protected]>" \
11961196
--no-thread \
1197-
$patches |
1198-
grep "In-Reply-To: <[email protected]>"
1197+
$patches >out &&
1198+
grep "In-Reply-To: <[email protected]>" out
11991199
'
12001200

12011201
test_expect_success $PREREQ 'no in-reply-to and no threading' '

t/t9116-git-svn-log.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,18 @@ test_expect_success 'setup repository and import' '
4343

4444
test_expect_success 'run log' "
4545
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
4952
"
5053

5154
test_expect_success 'run log against a from trunk' "
5255
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
5458
"
5559

5660
printf 'r1 \nr2 \nr4 \n' > expected-range-r1-r2-r4

0 commit comments

Comments
 (0)