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 <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Rast committed
Mar 1, 2012 at 22:40 UTC
61821aaa12ed698f2e94bb15fea958c598e4f231
1 file changed
+10
-14
t/t5510-fetch.sh
+10
-14
@@ -14,6 +14,14 @@ test_bundle_object_count () {
14
test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l)
15
}
16
17
+convert_bundle_to_pack () {
18
+ while read x && test -n "$x"
19
+ do
20
+ :;
21
+ done
22
+ cat
23
+}
24
+
25
test_expect_success setup '
26
echo >file original &&
27
git add file &&
@@ -207,13 +215,7 @@ test_expect_success 'unbundle 1' '
215
216
test_expect_success 'bundle 1 has only 3 files ' '
217
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 &&
219
git index-pack bundle.pack &&
220
test_bundle_object_count bundle.pack 3
221
'
@@ -230,13 +232,7 @@ test_expect_success 'bundle does not prerequisite objects' '
232
git add file2 &&
233
git commit -m add.file2 file2 &&
234
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 &&
236
git index-pack bundle.pack &&
237
test_bundle_object_count bundle.pack 3
238
'