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

[PATCH] t5500: fix mistaken $SERVER reference in helper function

From
Jeff King <peff@peff.net>
Date
Jun 19, 2024, 12:52 UTC
Message-ID
<20240619125255.GA346466@coredump.intra.peff.net>

The end of t5500 contains two tests which use a single helper function, fetch_filter_blob_limit_zero(). It takes a parameter to point to the path of the server repository, which we store locally as $SERVER. The first caller uses the relative path "server", while the second points into the httpd document root.

Commit 07ef3c6604 (fetch test: use more robust test for filtered objects, 2019-12-23) refactored some lines, but accidentally switched "$SERVER" to "server" in one spot. That means the second caller is looking at the server directory from the previous test rather than its own.

This happens to work out because the "server" directory from the first test is still hanging around, and the contents of the two are identical. But it was clearly not the intended behavior, and is fragile to cleaning up the leftovers from the first test.

Signed-off-by: Jeff King <peff@peff.net>
---
 t/t5500-fetch-pack.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
index 1bc15a3f08..b26f367620 100755
--- a/t/t5500-fetch-pack.sh
+++ b/t/t5500-fetch-pack.sh
@@ -1046,7 +1046,7 @@ fetch_filter_blob_limit_zero () {
 
 	# Ensure that commit is fetched, but blob is not
 	commit=$(git -C "$SERVER" rev-parse two) &&
-	blob=$(git hash-object server/two.t) &&
+	blob=$(git hash-object "$SERVER/two.t") &&
 	git -C client rev-list --objects --missing=allow-any "$commit" >oids &&
 	grep "$commit" oids &&
 	! grep "$blob" oids
-- 
2.45.2.949.g1c649f6aed
Next: Jonathan Nieder
Message 1 of 4 in “t5500: fix mistaken $SERVER reference in helper function”
  1. t5500: fix mistaken $SERVER reference in helper functionJeff King, Jun 19, 2024
  2. Jonathan NiederJun 20, 2024
  3. Jeff KingJun 20, 2024
  4. Junio C HamanoJun 20, 2024

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.