t5324: harmonize sha1/sha256 graph chain corruption
commit2d45710c5d1dc20db0d6c856e9e711dd6a19e18f
authorJeff King <peff@peff.net>
Thu, 28 Sep 2023 04:38:47 +0000 (28 00:38 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 28 Sep 2023 14:00:43 +0000 (28 07:00 -0700)
treeb9845685ee21bc98c92a4d5c18636ab4306e5a8e
parent8298b54317772ca28fec2673f59a8c2048552ae6
t5324: harmonize sha1/sha256 graph chain corruption

In t5324.20, we corrupt a hex character 60 bytes into the graph chain
file. Since the file consists of two hash identifiers, one per line, the
corruption differs between sha1 and sha256. In a sha1 repository, the
corruption is on the second line, and in a sha256 repository, it is on
the first.

We should of course detect the problem with either line. But as the next
few patches will show (and fix), that is not the case (in fact, we
currently do not exit non-zero for either line!). And while at the end
of our series we'll catch all errors, our intermediate states will have
differing behavior between the two hashes.

Let's make sure we test corruption of both the first and second lines,
and do so consistently with either hash by choosing offsets which are
always in the first hash (30 bytes) or in the second (70).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5324-split-commit-graph.sh