git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t4014-format-patch: do not assume 'test' is available as non-builtin

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Nov 23, 2009, 09:35 UTC
Message-ID
<4B0A5779.4050401@viscovery.net>
From: Johannes Sixt <j6t@kdbg.org>

One test case used 'xargs test', which assumes that 'test' is available as external program. At least on MinGW it is not.

Moreover, 'git format-patch' was invoked in a pipeline, but not as the last command. Rewrite the test case to catch breakage in 'git format-patch' as well.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 t/t4014-format-patch.sh |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh
index 5689d59..7f267f9 100755
--- a/t/t4014-format-patch.sh
+++ b/t/t4014-format-patch.sh
@@ -549,9 +549,7 @@ test_expect_success 'options no longer allowed for format-patch' '
 	test_cmp expect.check output'

 test_expect_success 'format-patch --numstat should produce a patch' '
-	git format-patch --numstat --stdout master..side |
-	grep "^diff --git a/" |
-	wc -l |
-	xargs test 6 = '
+	git format-patch --numstat --stdout master..side > output &&
+	test 6 = $(grep "^diff --git a/" output | wc -l)'

 test_done
-- 
1.6.6.rc0.1059.gdce25
Message 1 of 1 in “t4014-format-patch: do not assume 'test' is available as non-builtin”
  1. t4014-format-patch: do not assume 'test' is available as non-builtinJohannes Sixt, Nov 23, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.