Thread (29 messages) 29 messages, 6 authors, 2025-04-29
STALE420d

[PATCH v2 3/3] bundle-uri: add test for bundle-uri clones with tags

From: Scott Chacon via GitGitGadget <hidden>
Date: 2025-03-01 10:34:04
Subsystem: the rest · Maintainer: Linus Torvalds

From: Scott Chacon <redacted>

The change to the bundle-uri unbundling refspec now includes tags, so this
adds a simple test to make sure that tags in a bundle are properly added to
the cloned repository and will be included in ref negotiation with the
subsequent fetch.

Signed-off-by: Scott Chacon <redacted>
---
 t/t5558-clone-bundle-uri.sh | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
diff --git a/t/t5558-clone-bundle-uri.sh b/t/t5558-clone-bundle-uri.sh
index 33a7009e9a2..b1276ba295c 100755
--- a/t/t5558-clone-bundle-uri.sh
+++ b/t/t5558-clone-bundle-uri.sh
@@ -107,6 +107,37 @@ test_expect_success 'clone with file:// bundle' '
 	test_cmp expect actual
 '
 
+test_expect_success 'create bundle with tags' '
+	git init clone-from-tags &&
+	(
+		cd clone-from-tags &&
+		git checkout -b base &&
+		git checkout -b topic &&
+
+		test_commit A &&
+		git tag tag-A &&
+		git checkout -b base &&
+		git branch -d topic &&
+		test_commit B &&
+
+		git bundle create ALL.bundle --all &&
+		git bundle verify ALL.bundle
+	)
+'
+
+test_expect_success 'clone with tags bundle' '
+	git clone --bundle-uri="clone-from-tags/ALL.bundle" \
+		clone-from-tags clone-tags-path &&
+	git -C clone-tags-path for-each-ref --format="%(refname)" >refs &&
+	grep "refs/bundles/tags/" refs >actual &&
+	cat >expect <<-\EOF &&
+	refs/bundles/tags/A
+	refs/bundles/tags/B
+	refs/bundles/tags/tag-A
+	EOF
+	test_cmp expect actual
+'
+
 # To get interesting tests for bundle lists, we need to construct a
 # somewhat-interesting commit history.
 #
-- 
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