Skip to content

Commit

Permalink
t5510: refactor bundle->pack conversion
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Rast authored and Junio C Hamano committed Mar 1, 2012
1 parent 8a557bb commit 61821aa
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions t/t5510-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ test_bundle_object_count () {
test "$2" = $(grep '^[0-9a-f]\{40\} ' verify.out | wc -l)
}

convert_bundle_to_pack () {
while read x && test -n "$x"
do
:;
done
cat
}

test_expect_success setup '
echo >file original &&
git add file &&
Expand Down Expand Up @@ -207,13 +215,7 @@ test_expect_success 'unbundle 1' '

test_expect_success 'bundle 1 has only 3 files ' '
cd "$D" &&
(
while read x && test -n "$x"
do
:;
done
cat
) <bundle1 >bundle.pack &&
convert_bundle_to_pack <bundle1 >bundle.pack &&
git index-pack bundle.pack &&
test_bundle_object_count bundle.pack 3
'
Expand All @@ -230,13 +232,7 @@ test_expect_success 'bundle does not prerequisite objects' '
git add file2 &&
git commit -m add.file2 file2 &&
git bundle create bundle3 -1 HEAD &&
(
while read x && test -n "$x"
do
:;
done
cat
) <bundle3 >bundle.pack &&
convert_bundle_to_pack <bundle3 >bundle.pack &&
git index-pack bundle.pack &&
test_bundle_object_count bundle.pack 3
'
Expand Down

0 comments on commit 61821aa

Please sign in to comment.