lib/commit: Add a copy fastpath for imports
authorColin Walters <walters@verbum.org>
Wed, 20 Sep 2017 03:09:11 +0000 (23:09 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 26 Sep 2017 16:50:41 +0000 (16:50 +0000)
commit8a7a35970928331a028ccddd04590ac300dbd26e
treee852c66f59ab67dc07064566c4d6b835350073d7
parent3a08f7159d897533edda433ef2d98be93f02d6e0
lib/commit: Add a copy fastpath for imports

This fixes up the last of the embarassing bits I saw from
the stack trace in:
https://github.com/ostreedev/ostree/issues/1184

We had a hardlink fast path, but that doesn't apply across
devices, which occurs in two notable cases:

 - Installer ISO with local repo
 - Tools like pungi that copy the repo to a local snapshot

Obviously there are a lot of subtleties here around things like the
bare-user-only conversions as well as exactly what data we copy. I think to get
better test coverage we may want to add `pull-local --no-hardlink` or so.

Closes: #1197
Approved by: jlebon
src/libostree/ostree-repo-commit.c
tests/installed/itest-pull.sh