summaryrefslogtreecommitdiff
path: root/t/unit-tests/u-reftable-basics.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-10-09 21:56:25 +0000
committerJunio C Hamano <gitster@pobox.com>2025-10-09 17:46:15 -0700
commit5f23aa6f0f73bb2be7b64e56419e21b2c93cb9a7 (patch)
treec65df4cceb469b4d4dc233839e547c9a6adc0b19 /t/unit-tests/u-reftable-basics.c
parent51acda73d3ca96b763f0fca3d7b33b4beaef786d (diff)
t: allow specifying compatibility hash
We want to specify a compatibility hash for testing interactions for SHA-256 repositories where we have SHA-1 compatibility enabled. Allow the user to specify this scenario in the test suite by setting GIT_TEST_DEFAULT_HASH to "sha256:sha1". Note that this will get passed into GIT_DEFAULT_HASH, which Git itself does not presently support. However, we will support this in a future commit. Since we'll now want to know the value for a specific version, let's add the ability to specify either the storage hash (in this case, SHA-256) or the compatibility hash (SHA-1). We use a different value for the compatibility hash that will be enabled for all repositories (test_repo_compat_hash_algo) versus the one that is used individually in some tests (test_compat_hash_algo), since we want to still run those individual tests without requiring that the testsuite be run fully in a compatibility mode. In some cases, we'll need to adjust our test suite to work in a proper way with a compatibility hash. For example, in such a case, we'll only use pack index v3, since v1 and v2 lack support for multiple algorithms. Since we won't want to write those older formats, we'll need to skip tests that do so. Let's add a COMPAT_HASH prerequisite for this purpose. Finally, in this scenario, we can no longer rely on having broken objects work since we lack compatibility mappings to rewrite objects in the repository. Add a prerequisite, BROKEN_OBJECTS, that we define in terms of COMPAT_HASH and checks to see if creating deliberately broken objects is possible, so that we can disable these tests if not. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/u-reftable-basics.c')
0 files changed, 0 insertions, 0 deletions