From 8e69a9145091f37f8bd9d67b150eaaf5a6a65bf0 Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Wed, 29 Apr 2020 19:04:49 -0700 Subject: update: Restrict --commit to one app/runtime Currently if you run "flatpak update --commit=XYZ", we try to use that commit for every installed thing, which doesn't make much sense. Make it an error not to specify a ref with --commit. --- app/flatpak-builtins-update.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/flatpak-builtins-update.c b/app/flatpak-builtins-update.c index 3da7a067..1080f2b0 100644 --- a/app/flatpak-builtins-update.c +++ b/app/flatpak-builtins-update.c @@ -115,6 +115,10 @@ flatpak_builtin_update (int argc, n_prefs = 1; } + /* It doesn't make sense to use the same commit for more than one thing */ + if (opt_commit && n_prefs != 1) + return usage_error (context, _("With --commit, only one REF may be specified"), error); + transactions = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref); /* Walk through the array backwards so we can safely remove */ -- cgit v1.2.1