diff options
author | Colin Walters <walters@verbum.org> | 2018-03-05 10:42:19 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-03-05 17:39:35 +0000 |
commit | 79d6f635df47e6519d0211d08cce89b1034562bd (patch) | |
tree | 6e2e27a0e148b0f82b83aad11ef1c9fedb1e4a77 /src/ostree/ot-builtin-prune.c | |
parent | 733c0498dca8926e9078563240bd06a488fcd527 (diff) | |
download | ostree-79d6f635df47e6519d0211d08cce89b1034562bd.tar.gz |
prune: Error if --static-deltas-only without --delete-commit
The original changes here apparently had the *idea* that `--static-deltas-only`
would be useful in general, but we never implemented that. The current
situation where it's ignored unless `--delete-commit` is specified is
very misleading and I can easily see it leading to data loss for people.
Let's error out until we have a chance to make it actually useful.
Related: https://github.com/ostreedev/ostree/issues/1479
Closes: #1482
Approved by: giuseppe
Diffstat (limited to 'src/ostree/ot-builtin-prune.c')
-rw-r--r-- | src/ostree/ot-builtin-prune.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ostree/ot-builtin-prune.c b/src/ostree/ot-builtin-prune.c index 3f39dfe8..c34bbf4c 100644 --- a/src/ostree/ot-builtin-prune.c +++ b/src/ostree/ot-builtin-prune.c @@ -174,6 +174,15 @@ ostree_builtin_prune (int argc, char **argv, OstreeCommandInvocation *invocation else if (!delete_commit (repo, opt_delete_commit, cancellable, error)) return FALSE; } + else + { + /* In the future we should make this useful, but for now let's + * error out since what we were doing before was very misleading. + * https://github.com/ostreedev/ostree/issues/1479 + */ + if (opt_static_deltas_only) + return glnx_throw (error, "--static-deltas-only requires --delete-commit; see https://github.com/ostreedev/ostree/issues/1479"); + } OstreeRepoPruneFlags pruneflags = 0; if (opt_refs_only) |