lib/pull: Allow specific commits in P2P updates
authorMatthew Leeds <matthew.leeds@endlessm.com>
Thu, 18 Jan 2018 08:32:05 +0000 (00:32 -0800)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 24 Jan 2018 14:15:53 +0000 (14:15 +0000)
commit660bc588ee62717dbccaca18b6d2c5e4120c0901
tree78492c515bb48c737f06b15f44adf71dace9d9cb
parent42eea23864194d7429c974938be529a641e4f2ba
lib/pull: Allow specific commits in P2P updates

Currently users of the find_remotes_async()/pull_from_remotes_async()
functions have no way to specify a commit hash to use instead of the
latest one available. This commit implements an "override-commit-ids"
option analogous to the one used by ostree_repo_pull_with_options().
It's accomplished by returning OstreeRepoFinderResult objects pointing
to the given commit checksum(s) regardless of which ones were available
from the remotes, but in the future this implementation could be
improved to take into account the commits advertised by the remotes.

One effect of this is that flatpak will have the ability to downgrade
apps that use collection IDs
(https://github.com/flatpak/flatpak/issues/1309).

Closes: #1425
Approved by: pwithnall
src/libostree/ostree-repo-pull.c