From 166a4e144dc9296a2753c2e0123b8b65081d6331 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 14 Sep 2017 23:24:22 +0100 Subject: [PATCH] =?UTF-8?q?common:=20Don=E2=80=99t=20commit=20arbitrary=20?= =?UTF-8?q?files=20into=20the=20ostree-metadata=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When building the ostree-metadata branch (which only happens when configured with --enable-p2p), we are supposed to create empty commits which contain only metadata. However, the code to do this was wrong, and was instead pulling in all the files from the current working directory and committing them. Fix that code to actually create an empty commit. This could have been a fairly serious bug were it not for the fact that nobody’s using this code because it’s all experimental. Spotted as part of https://github.com/ostreedev/ostree/pull/1158. Signed-off-by: Philip Withnall Closes: #1066 Approved by: alexlarsson --- common/flatpak-utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/flatpak-utils.c b/common/flatpak-utils.c index 1445159e..2845a142 100644 --- a/common/flatpak-utils.c +++ b/common/flatpak-utils.c @@ -3412,8 +3412,9 @@ flatpak_repo_update (OstreeRepo *repo, if (!ostree_repo_prepare_transaction (repo, NULL, cancellable, error)) goto out; + /* Set up an empty mtree. */ mtree = ostree_mutable_tree_new (); - if (!ostree_repo_write_dfd_to_mtree (repo, AT_FDCWD, ".", mtree, NULL, NULL, error)) + if (!flatpak_mtree_create_root (repo, mtree, cancellable, error)) goto out; if (!ostree_repo_write_mtree (repo, mtree, (GFile **) &repo_file, NULL, error)) goto out;