prepare_resolve_p2p() return last_remote_commit

We want this in the transaction code, to see what commit would
be pulled, and thus if the data in the ostree-metadata is good enough
This commit is contained in:
Alexander Larsson
2019-10-15 15:20:31 +02:00
committed by Alexander Larsson
parent 5a01ff44d6
commit 64f8a26e33
2 changed files with 5 additions and 1 deletions

View File

@@ -946,6 +946,7 @@ typedef struct
/* Used during p2p resolve */
OstreeCollectionRef collection_ref; /* owns the collection_id member only, ref_name is from above */
char *local_commit;
char *latest_remote_commit;
/* out */
char *resolved_commit;

View File

@@ -3726,6 +3726,7 @@ flatpak_dir_resolve_free (FlatpakDirResolve *resolve)
g_free (resolve->eol_rebase);
g_free (resolve->collection_ref.collection_id);
g_free (resolve->local_commit);
g_free (resolve->latest_remote_commit);
g_free (resolve);
}
@@ -3908,10 +3909,12 @@ flatpak_dir_prepare_resolve_p2p_refs_helper (FlatpakDir *self,
FlatpakDirResolve *resolve = resolves->pdata[i];
const char *latest_rev = NULL;
latest_rev = find_latest_p2p_result (results, &resolve->collection_ref);
resolve->latest_remote_commit = g_strdup (latest_rev);
if (resolve->local_commit == NULL)
continue;
latest_rev = find_latest_p2p_result (results, &resolve->collection_ref);
if (g_strcmp0 (latest_rev, resolve->local_commit) == 0)
{
g_autoptr(GVariant) commit_data = NULL;