From abb097f812e30dc984bc6f490ff7cd00ab431d6d Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 4 Nov 2020 19:50:40 +0100 Subject: [PATCH] decomposed: Support defaults in flatpak_decomposed_new_from_parts This allows NULL for arch and branch, similar to e.g. flatpak_build_runtime_ref(). --- common/flatpak-ref-utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/flatpak-ref-utils.c b/common/flatpak-ref-utils.c index bceafd68..ea9e7cf0 100644 --- a/common/flatpak-ref-utils.c +++ b/common/flatpak-ref-utils.c @@ -907,6 +907,15 @@ flatpak_decomposed_new_from_parts (FlatpakKinds kind, const char *branch, GError **error) { + g_assert (kind == FLATPAK_KINDS_APP || kind == FLATPAK_KINDS_RUNTIME); + g_assert (id != NULL); + + if (branch == NULL) + branch = "master"; + + if (arch == NULL) + arch = flatpak_get_arch (); + return flatpak_decomposed_new_from_decomposed (NULL, kind, id, arch, branch, error); }