[RFC PATCH v2 33/36] t5601: basic bundle URI test
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Apr 18, 2022, 17:23 UTC
- Message-ID
- <RFC-patch-v2-33.36-52ee1e08dec-20220418T165545Z-avarab@gmail.com>
- In-Reply-To
- <RFC-cover-v2-00.36-00000000000-20220418T165545Z-avarab@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>
This test demonstrates an end-to-end form of the bundle URI feature given by an HTTP server advertising the 'features' capability with a bundle URI that is a bundle file on that same HTTP server. We verify that we unbundled a bundle, which could only have happened if we successfully downloaded that file.
RFC-TODO: Create similar tests throughout the series that perform similar tests, including examples with table of contents and partial clones.
Signed-off-by: Derrick Stolee <derrickstolee@github.com> --- t/t5601-clone.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 4a61f2c901e..e6119f78aea 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -767,6 +767,21 @@ test_expect_success 'reject cloning shallow repository using HTTP' ' git clone --no-reject-shallow $HTTPD_URL/smart/repo.git repo ' +test_expect_success 'auto-discover bundle URI from HTTP clone' ' + test_when_finished rm -rf repo "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" && + git -C src bundle create "$HTTPD_DOCUMENT_ROOT_PATH/everything.bundle" --all && + git clone --bare --no-local src "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" && + git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \ + serve.bundleuri $HTTPD_URL/everything.bundle && + GIT_TRACE2_EVENT="$(pwd)/trace.txt" \ + git -c protocol.version=2 clone \ + $HTTPD_URL/smart/repo2.git repo && + cat >pat <<-\EOF && + "event":"child_start".*"argv":\["git","bundle","unbundle" + EOF + grep -f pat trace.txt +' + # DO NOT add non-httpd-specific tests here, because the last part of this # test script is only executed when httpd is available and enabled.
-- 2.36.0.rc2.902.g60576bbc845