lib/repo: Do account for size with prune --no-prune

I think this got changed in a refactor.  We definitely want
to total up the amount of space that *would* be freed even
with `--no-prune` AKA `OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE`.

It's actually a bit terrifying this is apparently the first test case for
the `--no-prune` option...

Closes: https://github.com/ostreedev/ostree/issues/1480

Closes: #1483
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2018-03-05 16:58:12 +00:00
1 parent 1214395f0e
commit 733c0498dc
2 files changed
+17 -7

No files matched your search

+7
View File
@@ -52,6 +52,13 @@ assert_repo_has_n_commits() {
assert_streq "$(find ${repo}/objects -name '*.commit' | wc -l)" "${count}"
}
# Test --no-prune
objectcount_orig=$(find repo/objects | wc -l)
${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=0 --no-prune | tee noprune.txt
assert_file_has_content noprune.txt 'Would delete: [1-9][0-9]* objects, freeing [1-9][0-9]*'
objectcount_new=$(find repo/objects | wc -l)
assert_streq "${objectcount_orig}" "${objectcount_new}"
${CMD_PREFIX} ostree prune --repo=repo --refs-only --depth=2 -v
assert_repo_has_n_commits repo 3
find repo/objects -name '*.tombstone-commit' | wc -l > tombstonecommitcount