X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft1010-mktree.sh;h=b946f8768649dd76d8a175877c63d49244e00ffb;hb=bcacc0ebdb17b55040826bf82d1bde4070119250;hp=4d9b1383c67d2a736899ca3e52c99608bdb7724c;hpb=801cfae8fd683761ae268cab8cec08e4b0f5a35b;p=git.git diff --git a/t/t1010-mktree.sh b/t/t1010-mktree.sh index 4d9b1383c..b946f8768 100755 --- a/t/t1010-mktree.sh +++ b/t/t1010-mktree.sh @@ -10,6 +10,11 @@ test_expect_success setup ' mkdir "$d" && echo "$d/one" >"$d/one" && git add "$d" 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 && echo one >one && git add one && git write-tree >tree && @@ -48,14 +53,17 @@ test_expect_success 'ls-tree output in wrong order given to mktree (2)' ' test_cmp tree.withsub actual ' -test_expect_failure 'mktree reads ls-tree -r output (1)' ' - git mktree actual && - test_cmp tree actual +test_expect_success 'allow missing object with --missing' ' + git mktree --missing actual && + test_cmp tree.missing actual ' -test_expect_failure 'mktree reads ls-tree -r output (2)' ' - git mktree actual && - test_cmp tree.withsub actual +test_expect_success 'mktree refuses to read ls-tree -r output (1)' ' + test_must_fail git mktree actual +' + +test_expect_success 'mktree refuses to read ls-tree -r output (2)' ' + test_must_fail git mktree actual ' test_done