From 1c64e79a622b43cff2d919632393c51f3fcc4f43 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 10 May 2009 11:30:03 -0700 Subject: mktree --missing: allow missing objects We need to allow input lines that point at objects that we do not have when dealing with submodule entries anyway. This adds an explicit option to allow missing objects of other types, to be consistent with the use of --info-only option to the update-index command and --missing-ok option to the write-tree command. Signed-off-by: Junio C Hamano --- t/t1010-mktree.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 't') diff --git a/t/t1010-mktree.sh b/t/t1010-mktree.sh index 4d9b1383c6..9956e3ad62 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,6 +53,11 @@ 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' ' + git mktree --missing actual && + test_cmp tree.missing actual +' + test_expect_failure 'mktree reads ls-tree -r output (1)' ' git mktree actual && test_cmp tree actual -- cgit v1.2.3