Git fork

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>

authored by

brian m. carlson and committed by
Junio C Hamano
db00605c 5f23aa6f

+8 -5
+8 -5
t/t1010-mktree.sh
··· 11 11 git add "$d" || return 1 12 12 done && 13 13 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 && 18 21 echo one >one && 19 22 git add one && 20 23 git write-tree >tree && ··· 53 56 test_cmp tree.withsub actual 54 57 ' 55 58 56 - test_expect_success 'allow missing object with --missing' ' 59 + test_expect_success BROKEN_OBJECTS 'allow missing object with --missing' ' 57 60 git mktree --missing <top.missing >actual && 58 61 test_cmp tree.missing actual 59 62 '