1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 13:31:48 +02:00

fetchToStore(): Handle flat ingestion method and add test

This commit is contained in:
Eelco Dolstra 2023-10-20 13:32:15 +02:00
parent 173abec0bc
commit 7a086a32bc
3 changed files with 20 additions and 9 deletions

View file

@ -14,7 +14,10 @@ StorePath InputAccessor::fetchToStore(
Activity act(*logger, lvlChatty, actUnknown, fmt("copying '%s' to the store", showPath(path)));
auto source = sinkToSource([&](Sink & sink) {
dumpPath(path, sink, filter ? *filter : defaultPathFilter);
if (method == FileIngestionMethod::Recursive)
dumpPath(path, sink, filter ? *filter : defaultPathFilter);
else
sink(readFile(path)); // FIXME: stream
});
auto storePath =