[ostree] core: Do enumerate ff/ objects as well



commit e3928205413592ad9f687746401fe484983ecbe8
Author: Colin Walters <walters verbum org>
Date:   Sun Jul 20 12:20:51 2014 -0400

    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

 src/libostree/ostree-repo.c |    2 +-
 tests/test-basic.sh         |   13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 1aa48e6..6f04360 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -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];
diff --git a/tests/test-basic.sh b/tests/test-basic.sh
index dfad255..19e98b1 100755
--- a/tests/test-basic.sh
+++ b/tests/test-basic.sh
@@ -236,6 +236,19 @@ 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
 assert_file_has_content reflist '^test3$'


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]