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
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-10-10 13:02:08 +00:00
1 parent fc33ae018d
commit bba7eb8069
6 files changed
+65 -1

No files matched your search

+11
View File
@@ -167,6 +167,17 @@ Boston, MA 02111-1307, USA.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--consume</option></term>
<listitem><para>
When committing from a local directory (i.e. not an archive or --tree=ref),
assume ownership of the content. This may simply involve deleting it,
but if possible, the content may simply be <literal>rename()</literal>ed
into the repository rather than creating a new copy.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>--statoverride</option>="PATH"</term>