Skip to content

Commit 30310f3

Browse files
SiddharthShrimaligitster
authored andcommitted
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 <ps@pks.im> Signed-off-by: Siddharth Shrimali <r.siddharth.shrimali@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 67ad421 commit 30310f3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t3200-branch.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,8 @@ test_expect_success 'refuse --edit-description on unborn branch for now' '
14941494
'
14951495

14961496
test_expect_success '--merged catches invalid object names' '
1497-
test_must_fail git branch --merged 0000000000000000000000000000000000000000
1497+
test_must_fail git branch --merged $ZERO_OID 2>err &&
1498+
test_grep "must point to a commit" err
14981499
'
14991500

15001501
test_expect_success '--list during rebase' '

0 commit comments

Comments
 (0)