Made wider use of flatpak_repo_resolve_rev()

As described in the last commit message, it makes sense to move toward
using flatpak_repo_resolve_rev() rather than ostree_repo_resolve_rev()
for a few reasons:
1) It means we can use OSTREE_REPO_PULL_FLAGS_MIRROR which causes refs
to be pulled into repo/refs/mirrors/ rather than repo/refs/remotes/
which fixes a few edge cases of using collection IDs[1]
2) It falls back to using ostree_repo_resolve_rev() if
ostree_repo_resolve_collection_ref() fails so we can maintain backwards
compatibility for repo/refs/remotes/
3) It distinguishes between remote and local refs, and in the local case
uses OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY and
ostree_repo_resolve_rev_ext() to make sure we don't for example
accidentally use a remote's repo metadata rather than the local repo's
metadata for the "flatpak repo" command.

So this commit changes every instance of ostree_repo_resolve_rev() in
the codebase to flatpak_repo_resolve_rev().

[1] https://github.com/flatpak/flatpak/issues/1832

Closes: #2705
Approved by: alexlarsson
This commit is contained in:
Matthew Leeds
2019-02-24 21:28:19 -08:00
committed by Atomic Bot
parent 8cea78db1f
commit 253fcc6e35
7 changed files with 98 additions and 95 deletions

View File

@@ -212,7 +212,7 @@ add_icon_to_metadata (const char *icon_size_name,
}
static gboolean
build_bundle (OstreeRepo *repo, GFile *file,
build_bundle (OstreeRepo *repo, const char *collection_id, GFile *file,
const char *name, const char *full_branch,
const char *from_commit,
GCancellable *cancellable, GError **error)
@@ -228,9 +228,9 @@ build_bundle (OstreeRepo *repo, GFile *file,
g_autoptr(GBytes) gpg_data = NULL;
g_autoptr(GVariant) params = NULL;
g_autoptr(GVariant) metadata = NULL;
const char *collection_id;
if (!ostree_repo_resolve_rev (repo, full_branch, FALSE, &commit_checksum, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, full_branch, FALSE,
&commit_checksum, cancellable, error))
return FALSE;
if (!ostree_repo_read_commit (repo, commit_checksum, &root, NULL, NULL, error))
@@ -294,7 +294,6 @@ build_bundle (OstreeRepo *repo, GFile *file,
if (opt_runtime_repo)
g_variant_builder_add (&metadata_builder, "{sv}", "runtime-repo", g_variant_new_string (opt_runtime_repo));
collection_id = ostree_repo_get_collection_id (repo);
g_variant_builder_add (&metadata_builder, "{sv}", "collection-id",
g_variant_new_string (collection_id ? collection_id : ""));
@@ -382,7 +381,7 @@ add_icon_to_annotations (const char *icon_size_name,
}
static gboolean
build_oci (OstreeRepo *repo, GFile *dir,
build_oci (OstreeRepo *repo, const char *collection_id, GFile *dir,
const char *name, const char *ref,
GCancellable *cancellable, GError **error)
{
@@ -411,7 +410,8 @@ build_oci (OstreeRepo *repo, GFile *dir,
g_autofree char *metadata_contents = NULL;
g_auto(GStrv) ref_parts = NULL;
if (!ostree_repo_resolve_rev (repo, ref, FALSE, &commit_checksum, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, ref, FALSE,
&commit_checksum, cancellable, error))
return FALSE;
if (!ostree_repo_read_commit (repo, commit_checksum, &root, NULL, NULL, error))
@@ -544,6 +544,7 @@ flatpak_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable,
const char *name;
const char *branch;
g_autofree char *full_branch = NULL;
const char *collection_id;
context = g_option_context_new (_("LOCATION FILENAME NAME [BRANCH] - Create a single file bundle from a local repository"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -578,7 +579,9 @@ flatpak_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable,
return FALSE;
}
if (ostree_repo_resolve_rev (repo, name, FALSE, NULL, NULL))
collection_id = ostree_repo_get_collection_id (repo);
if (flatpak_repo_resolve_rev (repo, collection_id, NULL, name, FALSE, NULL, NULL, NULL))
full_branch = g_strdup (name);
else
{
@@ -601,12 +604,12 @@ flatpak_builtin_build_bundle (int argc, char **argv, GCancellable *cancellable,
if (opt_oci)
{
if (!build_oci (repo, file, name, full_branch, cancellable, error))
if (!build_oci (repo, collection_id, file, name, full_branch, cancellable, error))
return FALSE;
}
else
{
if (!build_bundle (repo, file, name, full_branch, opt_from_commit, cancellable, error))
if (!build_bundle (repo, collection_id, file, name, full_branch, opt_from_commit, cancellable, error))
return FALSE;
}

View File

@@ -240,6 +240,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
struct timespec ts;
guint64 timestamp;
int i;
const char *src_collection_id;
context = g_option_context_new (_("DST-REPO [DST-REF…] - Make a new commit from existing commits"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -362,13 +363,15 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
}
}
src_collection_id = ostree_repo_get_collection_id (src_repo);
resolved_src_refs = g_ptr_array_new_with_free_func (g_free);
for (i = 0; i < src_refs->len; i++)
{
const char *src_ref = g_ptr_array_index (src_refs, i);
char *resolved_ref;
if (!ostree_repo_resolve_rev (src_repo, src_ref, FALSE, &resolved_ref, error))
if (!flatpak_repo_resolve_rev (src_repo, src_collection_id, NULL, src_ref, FALSE,
&resolved_ref, cancellable, error))
return FALSE;
g_ptr_array_add (resolved_src_refs, resolved_ref);
@@ -444,7 +447,10 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
const char *main_collection_id = NULL;
g_autoptr(GPtrArray) collection_ids = NULL;
if (!ostree_repo_resolve_rev (dst_repo, dst_ref, TRUE, &dst_parent, error))
dst_collection_id = ostree_repo_get_collection_id (dst_repo);
if (!flatpak_repo_resolve_rev (dst_repo, dst_collection_id, NULL, dst_ref, TRUE,
&dst_parent, cancellable, error))
return FALSE;
if (dst_parent != NULL &&
@@ -484,8 +490,6 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
if (opt_body)
body = (const char *) opt_body;
dst_collection_id = ostree_repo_get_collection_id (dst_repo);
collection_ids = g_ptr_array_new_with_free_func (g_free);
if (dst_collection_id)
{

View File

@@ -905,14 +905,18 @@ flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable,
if (g_file_query_exists (repofile, cancellable) &&
!is_empty_directory (repofile, cancellable))
{
const char *repo_collection_id;
if (!ostree_repo_open (repo, cancellable, error))
goto out;
if (!ostree_repo_resolve_rev (repo, full_branch, TRUE, &parent, error))
repo_collection_id = ostree_repo_get_collection_id (repo);
if (!flatpak_repo_resolve_rev (repo, repo_collection_id, NULL, full_branch, TRUE,
&parent, cancellable, error))
goto out;
if (opt_collection_id != NULL &&
g_strcmp0 (ostree_repo_get_collection_id (repo), opt_collection_id) != 0)
g_strcmp0 (repo_collection_id, opt_collection_id) != 0)
{
flatpak_fail (error, "Specified collection ID %s doesnt match collection ID in repository configuration %s.",
opt_collection_id, ostree_repo_get_collection_id (repo));

View File

@@ -60,6 +60,7 @@ flatpak_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GE
int i;
char **iter;
g_autoptr(GPtrArray) refs = g_ptr_array_new_with_free_func (g_free);
const char *collection_id;
context = g_option_context_new (_("LOCATION [ID [BRANCH]] - Sign an application or runtime"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -97,6 +98,8 @@ flatpak_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GE
if (!ostree_repo_open (repo, cancellable, error))
return FALSE;
collection_id = ostree_repo_get_collection_id (repo);
if (id)
{
g_autofree char *ref = NULL;
@@ -132,7 +135,8 @@ flatpak_builtin_build_sign (int argc, char **argv, GCancellable *cancellable, GE
{
const char *ref = g_ptr_array_index (refs, i);
if (!ostree_repo_resolve_rev (repo, ref, FALSE, &commit_checksum, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, ref, FALSE,
&commit_checksum, cancellable, error))
return FALSE;
for (iter = opt_gpg_key_ids; iter && *iter; iter++)

View File

@@ -370,9 +370,11 @@ out:
}
static gboolean
print_commits (OstreeRepo *repo,
const char *ref,
GError **error)
print_commits (OstreeRepo *repo,
const char *collection_id,
const char *ref,
GCancellable *cancellable,
GError **error)
{
g_autofree char *checksum = NULL;
g_autoptr(GPtrArray) deltas = NULL;
@@ -380,7 +382,8 @@ print_commits (OstreeRepo *repo,
if (!ostree_repo_list_static_delta_names (repo, &deltas, NULL, error))
return FALSE;
if (!ostree_repo_resolve_rev (repo, ref, FALSE, &checksum, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, ref, FALSE, &checksum,
cancellable, error))
return FALSE;
if (!log_commit (repo, checksum, FALSE, deltas, error))
@@ -412,6 +415,7 @@ flatpak_builtin_repo (int argc, char **argv,
g_autoptr(OstreeRepo) repo = NULL;
const char *ostree_metadata_ref = NULL;
g_autofree char *ostree_metadata_checksum = NULL;
const char *collection_id;
context = g_option_context_new (_("LOCATION - Repository maintenance"));
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
@@ -427,11 +431,13 @@ flatpak_builtin_repo (int argc, char **argv,
if (!ostree_repo_open (repo, cancellable, error))
return FALSE;
collection_id = ostree_repo_get_collection_id (repo);
/* Try loading the metadata from the ostree-metadata branch first. If that
* fails, fall back to the summary file. */
ostree_metadata_ref = OSTREE_REPO_METADATA_REF;
if (!ostree_repo_resolve_rev_ext (repo, ostree_metadata_ref,
TRUE, 0, &ostree_metadata_checksum, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, ostree_metadata_ref,
TRUE, &ostree_metadata_checksum, cancellable, error))
return FALSE;
if (ostree_metadata_checksum != NULL)
@@ -476,7 +482,7 @@ flatpak_builtin_repo (int argc, char **argv,
if (opt_commits_branch)
{
if (!print_commits (repo, opt_commits_branch, error))
if (!print_commits (repo, collection_id, opt_commits_branch, cancellable, error))
return FALSE;
}

View File

@@ -3203,7 +3203,6 @@ flatpak_dir_deploy_appstream (FlatpakDir *self,
g_autoptr(GFile) timestamp_file = NULL;
g_autofree char *arch_path = NULL;
gboolean checkout_exists;
g_autofree char *remote_and_branch = NULL;
const char *old_dir = NULL;
g_autofree char *new_checksum = NULL;
g_autoptr(GFile) active_link = NULL;
@@ -3223,6 +3222,7 @@ flatpak_dir_deploy_appstream (FlatpakDir *self,
g_autofree char *filter_checksum = NULL;
g_autoptr(GRegex) allow_refs = NULL;
g_autoptr(GRegex) deny_refs = NULL;
g_autofree char *collection_id = NULL;
/* Keep a shared repo lock to avoid prunes removing objects we're relying on
* while we do the checkout. This could happen if the ref changes after we
@@ -3256,19 +3256,19 @@ flatpak_dir_deploy_appstream (FlatpakDir *self,
if (file_info != NULL)
old_dir = g_file_info_get_symlink_target (file_info);
collection_id = flatpak_dir_get_remote_collection_id (self, remote);
branch = g_strdup_printf ("appstream2/%s", arch);
remote_and_branch = g_strdup_printf ("%s:%s", remote, branch);
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, TRUE, &new_checksum, error))
if (!flatpak_repo_resolve_rev (self->repo, collection_id, remote, branch, TRUE,
&new_checksum, cancellable, error))
return FALSE;
if (new_checksum == NULL)
{
/* Fall back to old branch */
g_clear_pointer (&branch, g_free);
g_clear_pointer (&remote_and_branch, g_free);
branch = g_strdup_printf ("appstream/%s", arch);
remote_and_branch = g_strdup_printf ("%s:%s", remote, branch);
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, TRUE, &new_checksum, error))
if (!flatpak_repo_resolve_rev (self->repo, collection_id, remote, branch, TRUE,
&new_checksum, cancellable, error))
return FALSE;
do_compress = FALSE;
do_uncompress = TRUE;
@@ -4104,7 +4104,6 @@ flatpak_dir_update_appstream (FlatpakDir *self,
g_autofree char *new_branch = NULL;
g_autofree char *old_branch = NULL;
const char *used_branch = NULL;
g_autofree char *remote_and_branch = NULL;
g_autofree char *new_checksum = NULL;
g_autoptr(GError) first_error = NULL;
g_autoptr(GError) second_error = NULL;
@@ -4202,9 +4201,8 @@ flatpak_dir_update_appstream (FlatpakDir *self,
if (!child_repo_ensure_summary (child_repo, state, cancellable, error))
return FALSE;
remote_and_branch = g_strdup_printf ("%s:%s", remote, used_branch);
if (!ostree_repo_resolve_rev (child_repo, remote_and_branch, TRUE, &new_checksum, error))
if (!flatpak_repo_resolve_rev (child_repo, state->collection_id, remote, used_branch, TRUE,
&new_checksum, cancellable, error))
return FALSE;
child_repo_file = g_object_ref (ostree_repo_get_path (child_repo));
@@ -4257,9 +4255,8 @@ flatpak_dir_update_appstream (FlatpakDir *self,
}
}
remote_and_branch = g_strdup_printf ("%s:%s", remote, used_branch);
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, TRUE, &new_checksum, error))
if (!flatpak_repo_resolve_rev (self->repo, state->collection_id, remote, used_branch, TRUE,
&new_checksum, cancellable, error))
return FALSE;
return flatpak_dir_deploy_appstream (self,
@@ -4373,7 +4370,6 @@ repo_pull (OstreeRepo *self,
GError **error)
{
gboolean force_disable_deltas = (flatpak_flags & FLATPAK_PULL_FLAGS_NO_STATIC_DELTAS) != 0;
g_autofree char *remote_and_branch = NULL;
g_autofree char *current_checksum = NULL;
g_autoptr(GVariant) old_commit = NULL;
g_autoptr(GVariant) new_commit = NULL;
@@ -4392,17 +4388,17 @@ repo_pull (OstreeRepo *self,
/* We always want this on for every type of pull */
flags |= OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES;
remote_and_branch = g_strdup_printf ("%s:%s", remote_name, ref_to_fetch);
if (!ostree_repo_resolve_rev (self, remote_and_branch, TRUE, &current_checksum, error))
if (!repo_get_remote_collection_id (self, remote_name, &collection_id, NULL))
g_clear_pointer (&collection_id, g_free);
if (!flatpak_repo_resolve_rev (self, collection_id, remote_name, ref_to_fetch, TRUE,
&current_checksum, cancellable, error))
return FALSE;
if (current_checksum != NULL &&
!ostree_repo_load_commit (self, current_checksum, &old_commit, NULL, error))
return FALSE;
if (!repo_get_remote_collection_id (self, remote_name, &collection_id, NULL))
g_clear_pointer (&collection_id, g_free);
if (collection_id != NULL)
{
g_autoptr(GAsyncResult) find_result = NULL, pull_result = NULL;
@@ -5103,7 +5099,6 @@ flatpak_dir_pull (FlatpakDir *self,
const OstreeRepoFinderResult * const *results;
g_auto(GLnxLockFile) lock = { 0, };
g_autofree char *name = NULL;
g_autofree char *remote_and_branch = NULL;
g_autofree char *current_checksum = NULL;
/* If @opt_results is set, @opt_rev must be. */
@@ -5252,8 +5247,8 @@ flatpak_dir_pull (FlatpakDir *self,
error))
goto out;
remote_and_branch = g_strdup_printf ("%s:%s", state->remote_name, ref);
ostree_repo_resolve_rev (repo, remote_and_branch, TRUE, &current_checksum, NULL);
flatpak_repo_resolve_rev (repo, state->collection_id, state->remote_name, ref, TRUE,
&current_checksum, NULL, NULL);
if (!repo_pull (repo, state->remote_name,
subdirs_arg ? (const char **) subdirs_arg->pdata : NULL,
@@ -5408,7 +5403,6 @@ flatpak_dir_pull_untrusted_local (FlatpakDir *self,
g_autofree char *collection_id = NULL;
char *summary_data = NULL;
char *summary_sig_data = NULL;
g_autofree char *remote_and_branch = NULL;
gsize summary_data_size, summary_sig_data_size;
g_autoptr(GBytes) summary_bytes = NULL;
g_autoptr(GBytes) summary_sig_bytes = NULL;
@@ -5481,8 +5475,8 @@ flatpak_dir_pull_untrusted_local (FlatpakDir *self,
g_clear_object (&gpg_result);
remote_and_branch = g_strdup_printf ("%s:%s", remote_name, ref);
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, TRUE, &current_checksum, error))
if (!flatpak_repo_resolve_rev (self->repo, collection_id, remote_name, ref, TRUE,
&current_checksum, NULL, error))
return FALSE;
if (current_checksum != NULL &&
@@ -5505,7 +5499,8 @@ flatpak_dir_pull_untrusted_local (FlatpakDir *self,
}
else
{
if (!ostree_repo_resolve_rev (src_repo, remote_and_branch, FALSE, &checksum, error))
if (!flatpak_repo_resolve_rev (src_repo, collection_id, remote_name, ref, FALSE,
&checksum, NULL, error))
return FALSE;
}
@@ -5939,20 +5934,13 @@ flatpak_dir_read_latest_commit (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
g_autofree char *remote_and_ref = NULL;
g_autofree char *res = NULL;
g_autoptr(GVariant) commit_data = NULL;
g_autofree char *collection_id = NULL;
/* There may be several remotes with the same branch (if we for
* instance changed the origin) so prepend the current origin to
* make sure we get the right one */
if (remote)
remote_and_ref = g_strdup_printf ("%s:%s", remote, ref);
else
remote_and_ref = g_strdup (ref);
if (!ostree_repo_resolve_rev (self->repo, remote_and_ref, FALSE, &res, error))
collection_id = flatpak_dir_get_remote_collection_id (self, remote);
if (!flatpak_repo_resolve_rev (self->repo, collection_id, remote, ref, FALSE,
&res, cancellable, error))
return NULL;
if (!ostree_repo_load_commit (self->repo, res, &commit_data, NULL, error))
@@ -5973,20 +5961,13 @@ flatpak_dir_read_latest (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
g_autofree char *remote_and_ref = NULL;
g_autofree char *alt_id = NULL;
g_autofree char *res = NULL;
g_autofree char *collection_id = NULL;
/* There may be several remotes with the same branch (if we for
* instance changed the origin) so prepend the current origin to
* make sure we get the right one */
if (remote)
remote_and_ref = g_strdup_printf ("%s:%s", remote, ref);
else
remote_and_ref = g_strdup (ref);
if (!ostree_repo_resolve_rev (self->repo, remote_and_ref, FALSE, &res, error))
collection_id = flatpak_dir_get_remote_collection_id (self, remote);
if (!flatpak_repo_resolve_rev (self->repo, collection_id, remote, ref, FALSE,
&res, cancellable, error))
return NULL;
if (out_alt_id)
@@ -8992,14 +8973,13 @@ flatpak_dir_check_for_update (FlatpakDir *self,
GCancellable *cancellable,
GError **error)
{
g_autofree const char *remote_and_branch = NULL;
g_autofree char *latest_rev = NULL;
const char *target_rev = NULL;
if (no_pull)
{
remote_and_branch = g_strdup_printf ("%s:%s", state->remote_name, ref);
if (!ostree_repo_resolve_rev (self->repo, remote_and_branch, FALSE, &latest_rev, NULL))
if (!flatpak_repo_resolve_rev (self->repo, state->collection_id, state->remote_name,
ref, FALSE, &latest_rev, NULL, NULL))
{
g_set_error (error, FLATPAK_ERROR, FLATPAK_ERROR_ALREADY_INSTALLED,
_("%s already installed"), ref);
@@ -12819,7 +12799,6 @@ _flatpak_dir_fetch_remote_state_metadata_branch (FlatpakDir *self,
gboolean gpg_verify;
g_autofree char *checksum_from_summary = NULL;
g_autofree char *checksum_from_repo = NULL;
g_autofree char *refspec = NULL;
g_assert (state->collection_id != NULL);
@@ -12839,8 +12818,9 @@ _flatpak_dir_fetch_remote_state_metadata_branch (FlatpakDir *self,
OSTREE_REPO_METADATA_REF,
&checksum_from_summary, NULL);
refspec = g_strdup_printf ("%s:%s", state->remote_name, OSTREE_REPO_METADATA_REF);
if (!ostree_repo_resolve_rev (self->repo, refspec, TRUE, &checksum_from_repo, error))
if (!flatpak_repo_resolve_rev (self->repo, state->collection_id, state->remote_name,
OSTREE_REPO_METADATA_REF, TRUE, &checksum_from_repo,
cancellable, error))
return FALSE;
g_debug ("%s: Comparing %s from summary and %s from repo",
@@ -13637,7 +13617,6 @@ flatpak_dir_find_local_related_for_metadata (FlatpakDir *self,
FLATPAK_METADATA_KEY_LOCALE_SUBSET, NULL);
const char *branch;
g_autofree char *extension_ref = NULL;
g_autofree char *prefixed_extension_ref = NULL;
g_autofree char *checksum = NULL;
g_autofree char *extension_collection_id = NULL;
@@ -13668,12 +13647,14 @@ flatpak_dir_find_local_related_for_metadata (FlatpakDir *self,
extension_collection_id = g_strdup (collection_id);
extension_ref = g_build_filename ("runtime", extension, parts[2], branch, NULL);
prefixed_extension_ref = g_strdup_printf ("%s:%s", remote_name, extension_ref);
if (ostree_repo_resolve_rev (self->repo,
prefixed_extension_ref,
FALSE,
&checksum,
NULL))
if (flatpak_repo_resolve_rev (self->repo,
collection_id,
remote_name,
extension_ref,
FALSE,
&checksum,
NULL,
NULL))
{
add_related (self, related, extension, extension_collection_id, extension_ref,
checksum, no_autodownload, download_if, autoprune_unless, autodelete, locale_subset);
@@ -13685,16 +13666,16 @@ flatpak_dir_find_local_related_for_metadata (FlatpakDir *self,
for (j = 0; j < matches->len; j++)
{
const char *match = g_ptr_array_index (matches, j);
g_autofree char *prefixed_match = NULL;
g_autofree char *match_checksum = NULL;
prefixed_match = g_strdup_printf ("%s:%s", remote_name, match);
if (ostree_repo_resolve_rev (self->repo,
prefixed_match,
FALSE,
&match_checksum,
NULL))
if (flatpak_repo_resolve_rev (self->repo,
collection_id,
remote_name,
match,
FALSE,
&match_checksum,
NULL,
NULL))
{
add_related (self, related, extension,
extension_collection_id, match, match_checksum,

View File

@@ -3587,8 +3587,8 @@ flatpak_repo_update (OstreeRepo *repo,
old_summary = flatpak_repo_load_summary (repo, NULL);
if (!ostree_repo_resolve_rev (repo, OSTREE_REPO_METADATA_REF,
TRUE, &old_ostree_metadata_checksum, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, OSTREE_REPO_METADATA_REF,
TRUE, &old_ostree_metadata_checksum, cancellable, error))
return FALSE;
if (old_summary != NULL &&
@@ -4494,7 +4494,8 @@ flatpak_repo_generate_appstream (OstreeRepo *repo,
g_autofree char *commit_checksum = NULL;
branch = g_strdup_printf ("%s/%s", branch_prefix, arch);
if (!ostree_repo_resolve_rev (repo, branch, TRUE, &parent, error))
if (!flatpak_repo_resolve_rev (repo, collection_id, NULL, branch, TRUE,
&parent, cancellable, error))
return FALSE;
if (i == 0)