Skip to content

Commit 3d50ab9

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent befcc31 commit 3d50ab9

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

t/t1010-mktree.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ test_expect_success setup '
1111
git add "$d" || return 1
1212
done &&
1313
echo zero >one &&
14-
git update-index --add --info-only one &&
15-
git write-tree --missing-ok >tree.missing &&
16-
git ls-tree $(cat tree.missing) >top.missing &&
17-
git ls-tree -r $(cat tree.missing) >all.missing &&
14+
if test_have_prereq BROKEN_OBJECTS
15+
then
16+
git update-index --add --info-only one &&
17+
git write-tree --missing-ok >tree.missing &&
18+
git ls-tree $(cat tree.missing) >top.missing &&
19+
git ls-tree -r $(cat tree.missing) >all.missing
20+
fi &&
1821
echo one >one &&
1922
git add one &&
2023
git write-tree >tree &&
@@ -53,7 +56,7 @@ test_expect_success 'ls-tree output in wrong order given to mktree (2)' '
5356
test_cmp tree.withsub actual
5457
'
5558

56-
test_expect_success 'allow missing object with --missing' '
59+
test_expect_success BROKEN_OBJECTS 'allow missing object with --missing' '
5760
git mktree --missing <top.missing >actual &&
5861
test_cmp tree.missing actual
5962
'

0 commit comments

Comments
 (0)