lib/repo-refs: Include remote refs when using collections
authorMatthew Leeds <matthew.leeds@endlessm.com>
Tue, 22 Aug 2017 00:08:12 +0000 (17:08 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 24 Aug 2017 19:57:33 +0000 (19:57 +0000)
commit7ed881baa75192521fa972fa702c66470dc0a225
tree7a9894b29017f040486928c215e65a860b229bd4
parent95bac299e54020e6cc795b126deefc8c2c7820f4
lib/repo-refs: Include remote refs when using collections

When working with collections it can be useful to see remote refs rather
than just local and mirrored ones. This commit changes the "ostree refs
-c" output to include remote refs, and includes remote refs with
collection IDs in summary file generation as well. The former behavior
is consistent with how "ostree refs" works, and the latter behavior is
useful in facilitating P2P updates even when mirrors haven't been
configured.

To accomplish this, OstreeRepoListRefsExtFlags was extended with an
EXCLUDE_REMOTES flag. This was done rather than an INCLUDE_REMOTES flag
so that existing calls to ostree_repo_list_refs_ext continue to have the
same behavior. This flag was added to ostree_repo_list_collection_refs
(which is an experimental API break).

Also, add unit tests for the "refs -c" and summary file behavior, and
update relevant tests.

Closes: #1069
Approved by: cgwalters
12 files changed:
src/libostree/ostree-repo-finder-mount.c
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo-prune.c
src/libostree/ostree-repo-refs.c
src/libostree/ostree-repo.c
src/libostree/ostree-repo.h
src/ostree/ot-builtin-fsck.c
src/ostree/ot-builtin-prune.c
src/ostree/ot-builtin-refs.c
tests/test-find-remotes.sh
tests/test-refs-collections.sh
tests/test-summary-collections.sh