aboutsummaryrefslogtreecommitdiffstats
path: root/t/t1010-mktree.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-10-09 21:56:26 +0000
committerJunio C Hamano <gitster@pobox.com>2025-10-09 17:46:15 -0700
commitdb00605c13a9f5709da712671df5c7594c06cf31 (patch)
treececa263ce18fac84820c081544dafc01daa34b97 /t/t1010-mktree.sh
parent5f23aa6f0f73bb2be7b64e56419e21b2c93cb9a7 (diff)
downloadgit-db00605c13a9f5709da712671df5c7594c06cf31.tar.gz
t1010: use BROKEN_OBJECTS prerequisite
When hash compatibility mode is enabled, we cannot write broken objects because they cannot be mapped into the other hash algorithm. Use the BROKEN_OBJECTS prerequisite to disable these tests and the writing of broken objects in this mode. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t1010-mktree.sh')
-rwxr-xr-xt/t1010-mktree.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/t/t1010-mktree.sh b/t/t1010-mktree.sh
index e9973f7494..312fe6717a 100755
--- a/t/t1010-mktree.sh
+++ b/t/t1010-mktree.sh
@@ -11,10 +11,13 @@ test_expect_success setup '
git add "$d" || return 1
done &&
echo zero >one &&
- git update-index --add --info-only one &&
- git write-tree --missing-ok >tree.missing &&
- git ls-tree $(cat tree.missing) >top.missing &&
- git ls-tree -r $(cat tree.missing) >all.missing &&
+ if test_have_prereq BROKEN_OBJECTS
+ then
+ git update-index --add --info-only one &&
+ git write-tree --missing-ok >tree.missing &&
+ git ls-tree $(cat tree.missing) >top.missing &&
+ git ls-tree -r $(cat tree.missing) >all.missing
+ fi &&
echo one >one &&
git add one &&
git write-tree >tree &&
@@ -53,7 +56,7 @@ test_expect_success 'ls-tree output in wrong order given to mktree (2)' '
test_cmp tree.withsub actual
'
-test_expect_success 'allow missing object with --missing' '
+test_expect_success BROKEN_OBJECTS 'allow missing object with --missing' '
git mktree --missing <top.missing >actual &&
test_cmp tree.missing actual
'