Skip to content

Commit 61821aa

Browse files
trastgitster
authored andcommitted
t5510: refactor bundle->pack conversion
It's not so much a conversion as a "strip everything up to and including the first blank line", but it will come in handy again. Signed-off-by: Thomas Rast <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8a557bb commit 61821aa

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

t/t5510-fetch.sh

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ test_bundle_object_count () {
1414
test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l)
1515
}
1616

17+
convert_bundle_to_pack () {
18+
while read x && test -n "$x"
19+
do
20+
:;
21+
done
22+
cat
23+
}
24+
1725
test_expect_success setup '
1826
echo >file original &&
1927
git add file &&
@@ -207,13 +215,7 @@ test_expect_success 'unbundle 1' '
207215

208216
test_expect_success 'bundle 1 has only 3 files ' '
209217
cd "$D" &&
210-
(
211-
while read x && test -n "$x"
212-
do
213-
:;
214-
done
215-
cat
216-
) <bundle1 >bundle.pack &&
218+
convert_bundle_to_pack <bundle1 >bundle.pack &&
217219
git index-pack bundle.pack &&
218220
test_bundle_object_count bundle.pack 3
219221
'
@@ -230,13 +232,7 @@ test_expect_success 'bundle does not prerequisite objects' '
230232
git add file2 &&
231233
git commit -m add.file2 file2 &&
232234
git bundle create bundle3 -1 HEAD &&
233-
(
234-
while read x && test -n "$x"
235-
do
236-
:;
237-
done
238-
cat
239-
) <bundle3 >bundle.pack &&
235+
convert_bundle_to_pack <bundle3 >bundle.pack &&
240236
git index-pack bundle.pack &&
241237
test_bundle_object_count bundle.pack 3
242238
'

0 commit comments

Comments
 (0)