From 2d1c4fd72b40adbc8ddd691c863fbffa0d5be4bb Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 13 Dec 2017 13:33:32 +0100 Subject: [PATCH] build-export: scan repo for hardlinks on commit This is a no-op on regular (archive) repos, but on bare repos it is an optimization if the source is a checkout from the repo. This happens in flatpak-builder (https://github.com/flatpak/flatpak-builder/pull/81) when it commits the build to the cache during --install without --repo. Closes: #1249 Approved by: alexlarsson --- app/flatpak-builtins-build-export.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c index d6066d70..5f549aaa 100644 --- a/app/flatpak-builtins-build-export.c +++ b/app/flatpak-builtins-build-export.c @@ -822,6 +822,12 @@ flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable, if (!ostree_repo_prepare_transaction (repo, NULL, cancellable, error)) goto out; + /* This is useful only if the target is a "bare" rep, but this happens + in flatpak-builder when commiting to the cache repo. For other repos + this is a no-op */ + if (!ostree_repo_scan_hardlinks (repo, cancellable, error)) + goto out; + mtree = ostree_mutable_tree_new (); if (!flatpak_mtree_create_root (repo, mtree, cancellable, error))