decomposed: Support defaults in flatpak_decomposed_new_from_parts

This allows NULL for arch and branch, similar to
e.g. flatpak_build_runtime_ref().
This commit is contained in:
Alexander Larsson
2020-11-04 19:50:40 +01:00
committed by Alexander Larsson
parent 3b63c51ce6
commit abb097f812

View File

@@ -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);
}