]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t: introduce DEFAULT_REPO_FORMAT prereq
authorPatrick Steinhardt <ps@pks.im>
Fri, 29 Dec 2023 07:26:26 +0000 (08:26 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Jan 2024 17:24:47 +0000 (09:24 -0800)
A limited number of tests require repositories to have the default
repository format or otherwise they would fail to run, e.g. because they
fail to detect the correct hash function. While the hash function is the
only extension right now that creates problems like this, we are about
to add a second extension for the ref format.

Introduce a new DEFAULT_REPO_FORMAT prereq that can easily be amended
whenever we add new format extensions. Next to making any such changes
easier on us, the prerequisite's name should also help to clarify the
intent better.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3200-branch.sh
t/test-lib.sh

index 6a316f081ee2267ebd0c545220b4de3e6e527101..de7d3014e4fb914012db343d9efd85a2818677b4 100755 (executable)
@@ -519,7 +519,7 @@ EOF
 
 mv .git/config .git/config-saved
 
-test_expect_success SHA1 'git branch -m q q2 without config should succeed' '
+test_expect_success DEFAULT_REPO_FORMAT 'git branch -m q q2 without config should succeed' '
        git branch -m q q2 &&
        git branch -m q2 q
 '
index 876b99562a323ee351d4afe0fe2afbca34fb46bc..dc03f06b8e90440e4a79c0bdc465e3960a50d412 100644 (file)
@@ -1936,6 +1936,10 @@ test_lazy_prereq SHA1 '
        esac
 '
 
+test_lazy_prereq DEFAULT_REPO_FORMAT '
+       test_have_prereq SHA1
+'
+
 # Ensure that no test accidentally triggers a Git command
 # that runs the actual maintenance scheduler, affecting a user's
 # system permanently.