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

[PATCH] tests: shell negation portability fix

From
Jeff King <peff@peff.net>
Date
Oct 13, 2008, 09:35 UTC
Message-ID
<20081013093558.GA17282@coredump.intra.peff.net>
Commit 969c8775 introduced a test which uses the non-portable construct:
  command1 && ! command2 | command3
which must be
  command1 && ! (command2 | command3)

to work on bsd shells (this is another example of bbf08124, which fixed several similar cases).

Signed-off-by: Jeff King <peff@peff.net>
---
I had totally forgotten about this monstrosity until my autobuild broke.
diff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh
index bc7a8a8..8f6aea4 100755
--- a/t/t4128-apply-root.sh
+++ b/t/t4128-apply-root.sh
@@ -72,7 +72,7 @@ test_expect_success 'apply --directory (delete file)' '
 	echo content >some/sub/dir/delfile &&
 	git add some/sub/dir/delfile &&
 	git apply --directory=some/sub/dir/ --index patch &&
-	! git ls-files | grep delfile
+	! (git ls-files | grep delfile)
 '
 
 cat > patch << 'EOF'
Message 1 of 1 in “tests: shell negation portability fix”
  1. tests: shell negation portability fixJeff King, Oct 13, 2008

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.