summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2018-02-12 11:56:20 -0800
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-13 14:38:11 +0000
commit19413cb02ea4cd8f4b2f43aec49306386885c1c6 (patch)
tree00774f0f151e55cabe95552a09e2e6b5436c663f
parent237b8ca9fffc7016469e7649c964fdabe7fd760c (diff)
downloadflatpak-19413cb02ea4cd8f4b2f43aec49306386885c1c6.tar.gz
dir: Squash empty collection IDs into NULL ones
repo_get_remote_collection_id() already squashes empty ("") collection IDs into NULL, and ignores the collection ID when P2P support isn't enabled. So use that helper function in flatpak_dir_get_remote_collection_id() for consistency. At the moment that function is only used in tests, so this doesn't immediately affect anything. Closes: #1411 Approved by: alexlarsson
-rw-r--r--common/flatpak-dir.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index d2d054f7..aa70c73b 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -8577,13 +8577,11 @@ char *
flatpak_dir_get_remote_collection_id (FlatpakDir *self,
const char *remote_name)
{
- GKeyFile *config = ostree_repo_get_config (self->repo);
- g_autofree char *group = get_group (remote_name);
+ g_autofree char *collection_id = NULL;
- if (config)
- return g_key_file_get_string (config, group, "collection-id", NULL);
+ repo_get_remote_collection_id (self->repo, remote_name, &collection_id, NULL);
- return NULL;
+ return g_steal_pointer (&collection_id);
}
char *