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

[PATCH] t1200: work around a bug in some implementations of "find"

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 26, 2009, 21:53 UTC
Message-ID
<7vocllxuza.fsf@alter.siamese.dyndns.org>

"find path ..." command should exit with zero status only when all path operands were traversed successfully. When a non-existent path is given, however, some implementations of "find" (e.g. OpenBSD 4.6) exit with zero status and break the last test in t1200.

Rewrite the test to check that there is no regular files in the objects fan-out directories to work around this bug; it is closer to what we are testing anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t1200-tutorial.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t1200-tutorial.sh b/t/t1200-tutorial.sh
index 238c2f1..ab55eda 100755
--- a/t/t1200-tutorial.sh
+++ b/t/t1200-tutorial.sh
@@ -259,7 +259,7 @@ test_expect_success 'git repack' 'git repack'
 test_expect_success 'git prune-packed' 'git prune-packed'
 test_expect_success '-> only packed objects' '
 	git prune && # Remove conflict marked blobs
-	! find .git/objects/[0-9a-f][0-9a-f] -type f
+	test $(find .git/objects/[0-9a-f][0-9a-f] -type f -print 2>/dev/null | wc -l) = 0
 '
 
 test_done
Message 1 of 1 in “t1200: work around a bug in some implementations of "find"”
  1. t1200: work around a bug in some implementations of "find"Junio C Hamano, Dec 26, 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.