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>
Scott Chacon committed
Apr 25, 2025 at 19:33 UTC
435b076ceb6e42c2c4c66422c036a02982b36bd4
1 file changed
+30
t/t5558-clone-bundle-uri.sh
+30
@@ -107,6 +107,36 @@ test_expect_success 'clone with file:// bundle' '
107
test_cmp expect actual
108
'
109
110
+test_expect_success 'create bundle with tags' '
111
+ git init clone-from-tags &&
112
+ (
113
+ cd clone-from-tags &&
114
+ git checkout -b base &&
115
+ git checkout -b topic &&
116
+
117
+ test_commit A &&
118
+ git tag tag-A &&
119
+ git checkout -b base &&
120
+ git branch -d topic &&
121
+ test_commit B &&
122
+
123
+ git bundle create ALL.bundle --all &&
124
+ git bundle verify ALL.bundle
125
+ )
126
+'
127
+
128
+test_expect_success 'clone with tags bundle' '
129
+ git clone --bundle-uri="clone-from-tags/ALL.bundle" \
130
+ clone-from-tags clone-tags-path &&
131
+
132
+ git -C clone-from-tags for-each-ref --format="%(refname:lstrip=1)" \
133
+ >expect &&
134
+ git -C clone-tags-path for-each-ref --format="%(refname:lstrip=2)" \
135
+ refs/bundles >actual &&
136
+
137
+ test_cmp expect actual
138
+'
139
+
140
# To get interesting tests for bundle lists, we need to construct a
141
# somewhat-interesting commit history.
142
#