From c261979e899d4d3b15b44ca774cecfcd0ba2d294 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 7 Sep 2026 19:59:39 +0000 Subject: [PATCH] t5324: adjust tests for corrupt commit-graph In a future commit, we'll no longer allow uppercase object IDs. When that happens, t5324 will fail because the error message from corrupting commit-graph files will be different. The current test looks for an error message that occurs when the commit-graph file has a name that is parseable as a valid object ID but is not a valid commit-graph file (which, on case-sensitive systems, is of course checked case sensitively). However, in the future, we need the object ID to continue to be valid, and that means that the hex character we use must be lowercase. In SHA-256, though, one of the characters we want to corrupt is legitimately already an "a", so switch to using the character "b" in both of these cases, which is the correct character for neither SHA-1 nor SHA-256. If we adopt another hash algorithm in the future, we may need to adjust these values again. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- t/t5324-split-commit-graph.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index bf7ba0e558..53cddfe437 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh @@ -349,7 +349,7 @@ test_expect_success 'verify after commit-graph-chain corruption (base)' ' test_must_fail git commit-graph verify 2>test_err && grep -v "^+" test_err >err && test_grep "invalid commit-graph chain" err && - corrupt_file "$graphdir/commit-graph-chain" 30 "A" && + corrupt_file "$graphdir/commit-graph-chain" 30 "b" && test_must_fail git commit-graph verify 2>test_err && grep -v "^+" test_err >err && test_grep "unable to find all commit-graph files" err @@ -364,7 +364,7 @@ test_expect_success 'verify after commit-graph-chain corruption (tip)' ' test_must_fail git commit-graph verify 2>test_err && grep -v "^+" test_err >err && test_grep "invalid commit-graph chain" err && - corrupt_file "$graphdir/commit-graph-chain" 70 "A" && + corrupt_file "$graphdir/commit-graph-chain" 70 "b" && test_must_fail git commit-graph verify 2>test_err && grep -v "^+" test_err >err && test_grep "unable to find all commit-graph files" err