commit: Add _CONSUME modifier flag
authorColin Walters <walters@verbum.org>
Tue, 3 Oct 2017 21:34:06 +0000 (17:34 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 10 Oct 2017 13:02:08 +0000 (13:02 +0000)
commitbba7eb80699cb789f31914bc98fc338c46237b37
tree95a2a7f56342aa968ad07ffafb810f78f45bc19c
parentfc33ae018dccbcab633b69474db0811987355212
commit: Add _CONSUME modifier flag

For many cases of commit, we can actually optimize things by simply "adopting"
the object rather than writing a new copy. For example, in rpm-ostree package
layering.

We can only make that optimization though if we take ownership of the file. This
commit hence adds an API where a caller tells us to do so. For now, that just
means we `unlink()` the files/dirs as we go, but we can now later add the
"adopt" optimization.

Closes: #1255
Approved by: jlebon
bash/ostree
man/ostree-commit.xml
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo.h
src/ostree/ot-builtin-commit.c
tests/basic-test.sh