]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0410-partial-clone.sh
Merge branch 'js/update-index-ignore-removal-for-skip-worktree'
[thirdparty/git.git] / t / t0410-partial-clone.sh
index d4b7e535ea134569ed8bf5643edf8d435a22bc1a..a3988bd4b8c893de246d12bf88e776c633550e24 100755 (executable)
@@ -429,6 +429,19 @@ test_expect_success 'rev-list dies for missing objects on cmd line' '
        done
 '
 
+test_expect_success 'single promisor remote can be re-initialized gracefully' '
+       # ensure one promisor is in the promisors list
+       rm -rf repo &&
+       test_create_repo repo &&
+       test_create_repo other &&
+       git -C repo remote add foo "file://$(pwd)/other" &&
+       git -C repo config remote.foo.promisor true &&
+       git -C repo config extensions.partialclone foo &&
+
+       # reinitialize the promisors list
+       git -C repo fetch --filter=blob:none foo
+'
+
 test_expect_success 'gc repacks promisor objects separately from non-promisor objects' '
        rm -rf repo &&
        test_create_repo repo &&
@@ -540,6 +553,20 @@ test_expect_success 'gc stops traversal when a missing but promised object is re
        ! grep "$TREE_HASH" out
 '
 
+test_expect_success 'do not fetch when checking existence of tree we construct ourselves' '
+       rm -rf repo &&
+       test_create_repo repo &&
+       test_commit -C repo base &&
+       test_commit -C repo side1 &&
+       git -C repo checkout base &&
+       test_commit -C repo side2 &&
+
+       git -C repo config core.repositoryformatversion 1 &&
+       git -C repo config extensions.partialclone "arbitrary string" &&
+
+       git -C repo cherry-pick side1
+'
+
 . "$TEST_DIRECTORY"/lib-httpd.sh
 start_httpd