From bf9772f2316a567566c20979e5247b2928287253 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 5 May 2017 15:17:13 +0100 Subject: [PATCH] libostree: Ensure progress keys are all always set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If one of the progress keys is set in a pull operation, a ::changed signal is emitted on the progress object, and the callback for that could query any of the progress keys — so they all need to be set, otherwise we get an assertion failure in ostree_async_progress_get() due to a named key not existing. Spotted by Dan Nicholson in PR #819. Signed-off-by: Philip Withnall Closes: #835 Approved by: cgwalters --- src/libostree/ostree-repo-pull.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c index 35598eca..12f93ab0 100644 --- a/src/libostree/ostree-repo-pull.c +++ b/src/libostree/ostree-repo-pull.c @@ -3477,6 +3477,9 @@ ostree_repo_pull_with_options (OstreeRepo *self, guint shift; GString *buf = g_string_new (""); + /* Ensure the rest of the progress keys are set appropriately. */ + update_progress (pull_data); + if (bytes_transferred < 1024) shift = 1; else