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

[PATCH] t3200: replace hardcoded null OID with $ZERO_OID

From
Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
Date
Mar 11, 2026, 10:58 UTC
Message-ID
<20260311105829.60508-1-r.siddharth.shrimali@gmail.com>

Taking into consideration the SHA-256 transition, the test suite must be updated to support the length of the underlying hash algorithm. Tests that rely on hardcoded 40-character strings to represent the null object ID will fail when run in a SHA-256 environment, which expects a 64-character hash.

Replace the hardcoded 40-zero string in the 'git branch --merged' test with the '$ZERO_OID' variable which is provided by the test framework. This ensures the test dynamically adapts to the correct null OID length and functions correctly regardless of the active hash algorithm.

Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com>
---
 t/t3200-branch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
index c58e505c43..ed317a75f5 100755
--- a/t/t3200-branch.sh
+++ b/t/t3200-branch.sh
@@ -1494,7 +1494,7 @@ test_expect_success 'refuse --edit-description on unborn branch for now' '
 '
 
 test_expect_success '--merged catches invalid object names' '
-	test_must_fail git branch --merged 0000000000000000000000000000000000000000
+	test_must_fail git branch --merged $ZERO_OID
 '
 
 test_expect_success '--list during rebase' '
-- 
2.51.2
Next: Patrick Steinhardt
Message 1 of 5 in “t3200: replace hardcoded null OID with $ZERO_OID”
  1. t3200: replace hardcoded null OID with $ZERO_OIDSiddharth Shrimali, Mar 11, 2026
  2. Patrick SteinhardtMar 11, 2026
  3. t3200: replace hardcoded null OID with $ZERO_OIDSiddharth Shrimali, Mar 11, 2026
  4. brian m. carlsonMar 11, 2026
  5. Patrick SteinhardtMar 12, 2026

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.