summaryrefslogtreecommitdiff
path: root/t/t5616-partial-clone.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-03 19:37:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-03 19:37:04 (GMT)
commitb4100f366c1e5adf3a254cdc6f832aa1a4461053 (patch)
tree0cd253a268b0b06a09dd3cf17e60b666d67632d5 /t/t5616-partial-clone.sh
parent3f02c0ad360d96e8dbba92f97b42ebbaa4319db1 (diff)
parentdb3c293ecded67128b74a03f01e65c6799ff1116 (diff)
downloadgit-b4100f366c1e5adf3a254cdc6f832aa1a4461053.zip
git-b4100f366c1e5adf3a254cdc6f832aa1a4461053.tar.gz
git-b4100f366c1e5adf3a254cdc6f832aa1a4461053.tar.bz2
Merge branch 'jt/lazy-fetch'
Updates to on-demand fetching code in lazily cloned repositories. * jt/lazy-fetch: fetch: no FETCH_HEAD display if --no-write-fetch-head fetch-pack: remove no_dependents code promisor-remote: lazy-fetch objects in subprocess fetch-pack: do not lazy-fetch during ref iteration fetch: only populate existing_refs if needed fetch: avoid reading submodule config until needed fetch: allow refspecs specified through stdin negotiator/noop: add noop fetch negotiator
Diffstat (limited to 't/t5616-partial-clone.sh')
-rwxr-xr-xt/t5616-partial-clone.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh
index 5a01466..f4d49d8 100755
--- a/t/t5616-partial-clone.sh
+++ b/t/t5616-partial-clone.sh
@@ -433,6 +433,26 @@ test_expect_success 'fetch lazy-fetches only to resolve deltas, protocol v2' '
grep "want $(cat hash)" trace
'
+test_expect_success 'fetch does not lazy-fetch missing targets of its refs' '
+ rm -rf server client trace &&
+
+ test_create_repo server &&
+ test_config -C server uploadpack.allowfilter 1 &&
+ test_config -C server uploadpack.allowanysha1inwant 1 &&
+ test_commit -C server foo &&
+
+ git clone --filter=blob:none "file://$(pwd)/server" client &&
+ # Make all refs point to nothing by deleting all objects.
+ rm client/.git/objects/pack/* &&
+
+ test_commit -C server bar &&
+ GIT_TRACE_PACKET="$(pwd)/trace" git -C client fetch \
+ --no-tags --recurse-submodules=no \
+ origin refs/tags/bar &&
+ FOO_HASH=$(git -C server rev-parse foo) &&
+ ! grep "want $FOO_HASH" trace
+'
+
# The following two tests must be in this order. It is important that
# the srv.bare repository did not have tags during clone, but has tags
# in the fetch.