diff options
author | Phaedrus Leeds <mwleeds@protonmail.com> | 2021-11-05 14:53:25 -0700 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2021-11-15 09:48:03 +0100 |
commit | f3214c59d2f687e47ab5d9a74d8a3ef45f8e0105 (patch) | |
tree | ce84756e79b84aa8a1315a86f2d7edb72a1d72cc | |
parent | fd4e9e84cde35ac4c763178521b7c2c5d5fe4b4f (diff) | |
download | flatpak-f3214c59d2f687e47ab5d9a74d8a3ef45f8e0105.tar.gz |
dir: Fix an issue with fetch_remote_ref_sync()
This commit is a follow-up to "Fix implementation of xa.noenumerate
remote option" since that turned out to break
flatpak_installation_fetch_remote_ref_sync() in some cases. I didn't see
it at the time, but flatpak_decomposed_get_collection_id() explains that
the collection ID shouldn't be set on FlatpakDecomposed objects, even
when the remote has a collection ID set, unless they are being used to
enumerate refs from a file:// URI rather than a configured remote. So
this commit changes list_remote_refs() and list_all_remote_refs() to
keep the xa.noenumerate implementation working and to get
fetch_remote_ref_sync() working again (since the latter uses
flatpak_decomposed_new_from_parts() and thus doesn't set a collection ID
on the FlatpakDecomposed object used for comparison).
-rw-r--r-- | common/flatpak-dir.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 578a0829..c4721667 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -12283,7 +12283,11 @@ flatpak_dir_list_all_remote_refs (FlatpakDir *self, { summary = var_summary_from_gvariant (subsummary); ref_map = var_summary_get_ref_map (summary); - populate_hash_table_from_refs_map (ret_all_refs, NULL, ref_map, state->collection_id, state); + + /* NOTE: collection id is NULL here not state->collection_id, see the + * note on flatpak_decomposed_get_collection_id() + */ + populate_hash_table_from_refs_map (ret_all_refs, NULL, ref_map, NULL /* collection id */, state); } } else if (state->summary != NULL) @@ -14361,7 +14365,7 @@ flatpak_dir_list_remote_refs (FlatpakDir *self, if (!ostree_parse_refspec (refspec, NULL, &ref, error)) return FALSE; - d = flatpak_decomposed_new_from_col_ref (ref, state->collection_id, NULL); + d = flatpak_decomposed_new_from_ref (ref, NULL); if (d) g_hash_table_insert (decomposed_local_refs, g_steal_pointer (&d), NULL); } |