Thread (45 messages) 45 messages, 6 authors, 2022-04-08
STALE1528d

[PATCH 25/25] t5601: basic bundle URI test

From: Derrick Stolee via GitGitGadget <hidden>
Date: 2022-02-23 18:32:15
Subsystem: the rest · Maintainer: Linus Torvalds

From: Derrick Stolee <redacted>

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 <redacted>
---
 t/t5601-clone.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 83c24fc97a7..b2409a4c04c 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -769,6 +769,18 @@ 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 &&
+	test_subcommand_inexact git bundle unbundle <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.
 
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help