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>2018-10-30 09:43:39 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-30 09:43:39 +0300
commit77d503757d6328703f9571a4432dd83800bc26bb (patch)
tree55b106aab90b9b44a8d8e7cc38af63f2a3e743b9 /t/t0410-partial-clone.sh
parentc670b1f876521c9f7cd40184bf7ed05aad843433 (diff)
parent8b10a206f090e01ce1ac4d9a10ec769e2409e2b0 (diff)
Merge branch 'md/filter-trees'
The "rev-list --filter" feature learned to exclude all trees via "tree:0" filter. * md/filter-trees: list-objects: support for skipping tree traversal filter-trees: code clean-up of tests list-objects-filter: implement filter tree:0 list-objects-filter-options: do not over-strbuf_init list-objects-filter: use BUG rather than die revision: mark non-user-given objects instead rev-list: handle missing tree objects properly list-objects: always parse trees gently list-objects: refactor to process_tree_contents list-objects: store common func args in struct
Diffstat (limited to 't/t0410-partial-clone.sh')
-rwxr-xr-xt/t0410-partial-clone.sh45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index c521d7d6c6..ba3887f178 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -239,6 +239,51 @@ test_expect_success 'rev-list stops traversal at missing and promised commit' '
! grep $FOO out
'
+test_expect_success 'missing tree objects with --missing=allow-promisor and --exclude-promisor-objects' '
+ rm -rf repo &&
+ test_create_repo repo &&
+ test_commit -C repo foo &&
+ test_commit -C repo bar &&
+ test_commit -C repo baz &&
+
+ promise_and_delete $(git -C repo rev-parse bar^{tree}) &&
+ promise_and_delete $(git -C repo rev-parse foo^{tree}) &&
+
+ git -C repo config core.repositoryformatversion 1 &&
+ git -C repo config extensions.partialclone "arbitrary string" &&
+
+ git -C repo rev-list --missing=allow-promisor --objects HEAD >objs 2>rev_list_err &&
+ test_must_be_empty rev_list_err &&
+ # 3 commits, 3 blobs, and 1 tree
+ test_line_count = 7 objs &&
+
+ # Do the same for --exclude-promisor-objects, but with all trees gone.
+ promise_and_delete $(git -C repo rev-parse baz^{tree}) &&
+ git -C repo rev-list --exclude-promisor-objects --objects HEAD >objs 2>rev_list_err &&
+ test_must_be_empty rev_list_err &&
+ # 3 commits, no blobs or trees
+ test_line_count = 3 objs
+'
+
+test_expect_success 'missing non-root tree object and rev-list' '
+ rm -rf repo &&
+ test_create_repo repo &&
+ mkdir repo/dir &&
+ echo foo >repo/dir/foo &&
+ git -C repo add dir/foo &&
+ git -C repo commit -m "commit dir/foo" &&
+
+ promise_and_delete $(git -C repo rev-parse HEAD:dir) &&
+
+ git -C repo config core.repositoryformatversion 1 &&
+ git -C repo config extensions.partialclone "arbitrary string" &&
+
+ git -C repo rev-list --missing=allow-any --objects HEAD >objs 2>rev_list_err &&
+ test_must_be_empty rev_list_err &&
+ # 1 commit and 1 tree
+ test_line_count = 2 objs
+'
+
test_expect_success 'rev-list stops traversal at missing and promised tree' '
rm -rf repo &&
test_create_repo repo &&