core: Add pack files

This concept is also directly inspired by git.  At present, our
implementation is quite similar, except we don't have delta
compression.
This commit is contained in:
Colin Walters committed 2012-03-31 11:51:47 -04:00
1 parent 68cce01556
commit 80bdfd7f42
18 files changed
+4379 -558

No files matched your search

+34 -1
View File
@@ -21,7 +21,7 @@ set -e
. libtest.sh
echo '1..10'
echo '1..19'
setup_test_repository "archive"
echo "ok setup"
@@ -67,3 +67,36 @@ cd ${test_tmpdir}
$OSTREE cat test2 /baz/cow > cow-contents
assert_file_has_content cow-contents "moo"
echo "ok cat-file"
cd ${test_tmpdir}
$OSTREE pack --keep-loose
echo "ok pack"
cd ${test_tmpdir}
$OSTREE fsck
echo "ok fsck"
$OSTREE checkout test2 checkout-test2-from-packed
echo "ok checkout union 1"
cd ${test_tmpdir}
$OSTREE pack
echo "ok pack delete loose"
cd ${test_tmpdir}
$OSTREE fsck
echo "ok fsck"
$OSTREE pack --analyze-only
echo "ok pack analyze"
$OSTREE unpack
echo "ok unpack"
cd ${test_tmpdir}
$OSTREE fsck
echo "ok fsck"
cd ${test_tmpdir}
$OSTREE checkout test2 checkout-test2-from-unpacked
echo "ok checkout union 2"
+20 -1
View File
@@ -21,7 +21,7 @@ set -e
. libtest.sh
echo '1..2'
echo '1..4'
setup_fake_remote_repo1
cd ${test_tmpdir}
@@ -29,6 +29,7 @@ mkdir repo
ostree --repo=repo init
ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
ostree-pull --repo=repo origin main
ostree --repo=repo fsck
echo "ok pull"
cd ${test_tmpdir}
@@ -37,3 +38,21 @@ cd checkout-origin-main
assert_file_has_content firstfile '^first$'
assert_file_has_content baz/cow '^moo$'
echo "ok pull contents"
cd ${test_tmpdir}
ostree --repo=$(pwd)/ostree-srv/gnomerepo pack
rm -rf repo
mkdir repo
ostree --repo=repo init
ostree --repo=repo remote add origin $(cat httpd-address)/ostree/gnomerepo
ostree-pull --repo=repo origin main
ostree --repo=repo fsck
echo "ok pull packed"
cd ${test_tmpdir}
rm -rf checkout-origin-main
$OSTREE checkout origin/main checkout-origin-main
cd checkout-origin-main
assert_file_has_content firstfile '^first$'
assert_file_has_content baz/cow '^moo$'
echo "ok pull contents packed"