diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index 03d525a61be..7e091ef1071 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -495,9 +495,9 @@ void InputScheme::clone( Activity act(*logger, lvlTalkative, actUnknown, fmt("copying '%s' to %s...", input2.to_string(), destDir)); - auto source = sinkToSource([&](Sink & sink) { accessor->dumpPath(CanonPath::root, sink); }); - - restorePath(destDir, *source); + RestoreSink sink(/*startFsync=*/false); + sink.dstPath = destDir; + copyRecursive(*accessor, CanonPath::root, sink, CanonPath::root); } std::optional InputScheme::experimentalFeature() const diff --git a/src/libutil/fs-sink.cc b/src/libutil/fs-sink.cc index 45c0262e620..a78fe1af422 100644 --- a/src/libutil/fs-sink.cc +++ b/src/libutil/fs-sink.cc @@ -37,7 +37,6 @@ void copyRecursive(SourceAccessor & accessor, const CanonPath & from, FileSystem sink.createDirectory(to, [&](FileSystemObjectSink & dirSink, const CanonPath & relDirPath) { for (auto & [name, _] : accessor.readDirectory(from)) { copyRecursive(accessor, from / name, dirSink, relDirPath / name); - break; } }); break;