diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 381cce47..a0f6db02 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -4567,7 +4567,8 @@ ostree_repo_pull_with_options (OstreeRepo *self, } } - if (pull_data->is_mirror && pull_data->summary_data && !refs_to_fetch && !configured_branches) + if (pull_data->is_mirror && pull_data->summary_data && + !refs_to_fetch && !opt_collection_refs_set && !configured_branches) { GLnxFileReplaceFlags replaceflag = pull_data->repo->disable_fsync ? GLNX_FILE_REPLACE_NODATASYNC : 0; diff --git a/tests/test-pull-collections.sh b/tests/test-pull-collections.sh index d1de5f88..cd60ab21 100755 --- a/tests/test-pull-collections.sh +++ b/tests/test-pull-collections.sh @@ -23,7 +23,7 @@ set -euo pipefail . $(dirname $0)/libtest.sh -echo '1..6' +echo '1..7' cd ${test_tmpdir} @@ -258,3 +258,15 @@ then fi echo "ok 6 pull refs from local repos" + +ostree_repo_init local-mirror +do_remote_add local-mirror collection-repo --collection-id org.example.CollectionRepo +# Generate a summary in the local mirror; don't use do_summary to avoid gpg +${CMD_PREFIX} ostree --repo=local-mirror summary --update +summarysig=$(sha256sum < local-mirror/summary | cut -f 1 -d ' ') +# Mirror subset of refs: A collection-ref version of https://github.com/ostreedev/ostree/issues/846 +${CMD_PREFIX} ostree --repo=local-mirror find-remotes --pull --mirror --finders=config org.example.CollectionRepo goodcref1 +newsummarysig=$(sha256sum < local-mirror/summary | cut -f 1 -d ' ') +assert_streq ${summarysig} ${newsummarysig} + +echo "ok 7 mirror pull subset of collection-refs with summary"