diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 82bf66f6..0d342d3f 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -2705,7 +2705,8 @@ ostree_repo_pull_with_options (OstreeRepo *self, &from_revision, error)) goto out; - if (!disable_static_deltas && (from_revision == NULL || g_strcmp0 (from_revision, to_revision) != 0)) + if (!disable_static_deltas && !pull_data->is_mirror && + (from_revision == NULL || g_strcmp0 (from_revision, to_revision) != 0)) { if (!request_static_delta_superblock_sync (pull_data, from_revision, to_revision, &delta_superblock, cancellable, error)) diff --git a/tests/pull-test.sh b/tests/pull-test.sh index 8e8a6934..b050e111 100755 --- a/tests/pull-test.sh +++ b/tests/pull-test.sh @@ -35,7 +35,7 @@ function verify_initial_contents() { assert_file_has_content baz/cow '^moo$' } -echo "1..11" +echo "1..12" # Try both syntaxes repo_init @@ -57,6 +57,17 @@ ${CMD_PREFIX} ostree --repo=mirrorrepo fsck $OSTREE show main >/dev/null echo "ok pull mirror" +cd ${test_tmpdir} +rm checkout-origin-main -rf +$OSTREE --repo=ostree-srv/gnomerepo checkout main checkout-origin-main +echo moomoo > checkout-origin-main/baz/cow +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo commit -b main -s "" --tree=dir=checkout-origin-main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo static-delta generate main +${CMD_PREFIX} ostree --repo=ostree-srv/gnomerepo fsck +${CMD_PREFIX} ostree --repo=mirrorrepo pull --mirror origin main +${CMD_PREFIX} ostree --repo=mirrorrepo fsck +echo "ok pull mirror (should not apply deltas)" + cd ${test_tmpdir} mkdir mirrorrepo-local ${CMD_PREFIX} ostree --repo=mirrorrepo-local init --mode=archive-z2