list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* [PATCH] t9001, t9116: avoid pipes
@ 2020-02-14 13:53 Johannes Schindelin via GitGitGadget
  0 siblings, 0 replies; only message in thread
From: Johannes Schindelin via GitGitGadget @ 2020-02-14 13:53 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Johannes Schindelin

From: Johannes Schindelin <>

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 <>
    Avoid pipes in git-svn tests
    This is one more of those patches that convert the pattern a | b to a
    >file && b<file so that failures in a are caught, too.

Fetch-It-Via: git fetch pr-git-709/dscho/avoid-pipes-in-svn-tests-v1

 t/  |  4 ++--
 t/ | 12 ++++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/t/ b/t/
index a834afab4d7..90f61c34009 100755
--- a/t/
+++ b/t/
@@ -1194,8 +1194,8 @@ test_expect_success $PREREQ 'in-reply-to but no threading' ' \
 		--in-reply-to="<>" \
 		--no-thread \
-		$patches |
-	grep "In-Reply-To: <>"
+		$patches >out &&
+	grep "In-Reply-To: <>" out
 test_expect_success $PREREQ 'no in-reply-to and no threading' '
diff --git a/t/ b/t/
index 45773ee560d..0a9f1ef366d 100755
--- a/t/
+++ b/t/
@@ -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

base-commit: d8437c57fa0752716dde2d3747e7c22bf7ce2e41

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-14 13:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 13:53 [PATCH] t9001, t9116: avoid pipes Johannes Schindelin via GitGitGadget list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone