Don't say "copying X to the store" in read-only mode

This commit is contained in:
Eelco Dolstra 2024-02-20 10:28:44 +01:00
parent 06be819b89
commit 6162105675

View file

@ -33,12 +33,15 @@ StorePath fetchToStore(
} else
debug("source path '%s' is uncacheable", path);
Activity act(*logger, lvlChatty, actUnknown, fmt("copying '%s' to the store", path));
auto readOnly = settings.readOnlyMode;
Activity act(*logger, lvlChatty, actUnknown,
fmt(readOnly ? "hashing '%s'" : "copying '%s' to the store", path));
auto filter2 = filter ? *filter : defaultPathFilter;
auto storePath =
settings.readOnlyMode
readOnly
? store.computeStorePath(
name, *path.accessor, path.path, method, HashAlgorithm::SHA256, {}, filter2).first
: store.addToStore(