From: Siddharth Shrimali Date: Wed, 11 Mar 2026 17:41:20 +0000 (+0530) Subject: t3200: replace hardcoded null OID with $ZERO_OID X-Git-Tag: v2.54.0-rc0~62^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=30310f3cc474ff26b8306da48566667f67206808;p=thirdparty%2Fgit.git t3200: replace hardcoded null OID with $ZERO_OID To support the SHA-256 transition, replace the hardcoded 40-zero string in 'git branch --merged' with '$ZERO_OID'. The current 40-character string causes the test to fail prematurely in SHA-256 environments because Git identifies a "malformed object name" (due to the 40 vs 64 character mismatch) before it even validates the object type. By using '$ZERO_OID', we ensure the hash length is always correct for the active algorithm. Additionally, use 'test_grep' to verify the "must point to a commit" error message, ensuring the test validates the object type logic rather than just string syntax. Suggested-by: Patrick Steinhardt Signed-off-by: Siddharth Shrimali Signed-off-by: Junio C Hamano --- diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index c58e505c43..e7829c2c4b 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -1494,7 +1494,8 @@ 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 2>err && + test_grep "must point to a commit" err ' test_expect_success '--list during rebase' '