Skip to content

Commit 435b076

Browse files
schacongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c858c64 commit 435b076

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

t/t5558-clone-bundle-uri.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,36 @@ test_expect_success 'clone with file:// bundle' '
107107
test_cmp expect actual
108108
'
109109

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+
110140
# To get interesting tests for bundle lists, we need to construct a
111141
# somewhat-interesting commit history.
112142
#

0 commit comments

Comments
 (0)