Skip to content

Commit b6d62a0

Browse files
bk2204gitster
authored andcommitted
t: add a prerequisite for a compatibility hash
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 and define the BROKEN_OBJECTS prerequisite in terms of it. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 691b34e commit b6d62a0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

t/test-lib.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,13 @@ test_lazy_prereq DEFAULT_REPO_FORMAT '
19221922
# compatibility, we cannot write such objects because there's no SHA-1
19231923
# compatibility value for a nonexistent object.
19241924
test_lazy_prereq BROKEN_OBJECTS '
1925-
test -z "$test_repo_compat_hash_algo"
1925+
! test_have_prereq COMPAT_HASH
1926+
'
1927+
1928+
# COMPAT_HASH is a test if we're operating in a repository with SHA-256 with
1929+
# SHA-1 compatibility.
1930+
test_lazy_prereq COMPAT_HASH '
1931+
test -n "$test_repo_compat_hash_algo"
19261932
'
19271933

19281934
# Ensure that no test accidentally triggers a Git command

0 commit comments

Comments
 (0)