Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-05-10 22:30:03 +0400
committerJunio C Hamano <gitster@pobox.com>2009-05-11 04:31:01 +0400
commit1c64e79a622b43cff2d919632393c51f3fcc4f43 (patch)
treec41997708c590da61789b3ed377933b96a6f4520 /t/t1010-mktree.sh
parent801cfae8fd683761ae268cab8cec08e4b0f5a35b (diff)
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 <gitster@pobox.com>
Diffstat (limited to 't/t1010-mktree.sh')
-rwxr-xr-xt/t1010-mktree.sh10
1 files changed, 10 insertions, 0 deletions
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 <top.missing >actual &&
+ test_cmp tree.missing actual
+'
+
test_expect_failure 'mktree reads ls-tree -r output (1)' '
git mktree <all >actual &&
test_cmp tree actual