core: Do enumerate ff/ objects as well

An embarassing off-by-one here.  I noticed we weren't pruning them.

https://bugzilla.gnome.org/show_bug.cgi?id=733458
This commit is contained in:
Colin Walters 2014-07-20 12:20:51 -04:00
parent 1834a71b1f
commit e392820541
2 changed files with 14 additions and 1 deletions

View File

@ -1083,7 +1083,7 @@ list_loose_objects (OstreeRepo *self,
int dfd = -1;
static const gchar hexchars[] = "0123456789abcdef";
for (c = 0; c < 255; c++)
for (c = 0; c < 256; c++)
{
char buf[3];
buf[0] = hexchars[c >> 4];

View File

@ -235,6 +235,19 @@ fi
rm repo3 objlist-before-prune objlist-after-prune -rf
echo "ok prune"
cd ${test_tmpdir}
rm repo3 -rf
${CMD_PREFIX} ostree --repo=repo3 init --mode=archive-z2
${CMD_PREFIX} ostree --repo=repo3 pull-local --remote=aremote repo test2
rm repo3/refs/remotes -rf
mkdir repo3/refs/remotes
ostree --repo=repo3 prune --refs-only
find repo3/objects -name '*.filez' > file-objects
if test -s file-objects; then
assert_not_reached "prune didn't delete all objects"
fi
echo "ok prune in archive-z2 deleted everything"
cd ${test_tmpdir}
$OSTREE commit -b test3 -s "Another commit" --tree=ref=test2
ostree --repo=repo refs > reflist