aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Chacon <schacon@gmail.com>2025-04-25 19:33:09 +0000
committerJunio C Hamano <gitster@pobox.com>2025-04-25 13:36:45 -0700
commit435b076ceb6e42c2c4c66422c036a02982b36bd4 (patch)
treefe3d76085a60d07ae4df4f1200b9e528343d2df3
parentbundle-uri: copy all bundle references ino the refs/bundle space (diff)
downloadgit-435b076ceb6e42c2c4c66422c036a02982b36bd4.tar.gz
git-435b076ceb6e42c2c4c66422c036a02982b36bd4.zip
bundle-uri: add test for bundle-uri clones with tags
The change to the bundle-uri unbundling refspec now includes tags, so this adds a very, very 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 <schacon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5558-clone-bundle-uri.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t5558-clone-bundle-uri.sh b/t/t5558-clone-bundle-uri.sh
index 33a7009e9a..9b211a626b 100755
--- a/t/t5558-clone-bundle-uri.sh
+++ b/t/t5558-clone-bundle-uri.sh
@@ -107,6 +107,36 @@ 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-from-tags for-each-ref --format="%(refname:lstrip=1)" \
+ >expect &&
+ git -C clone-tags-path for-each-ref --format="%(refname:lstrip=2)" \
+ refs/bundles >actual &&
+
+ test_cmp expect actual
+'
+
# To get interesting tests for bundle lists, we need to construct a
# somewhat-interesting commit history.
#