Skip to content

Commit d3ff01c

Browse files
authored
Merge pull request #14606 from NixOS/fix-copy-recursive
libutil: Fix copyRecursive and use for nix flake clone
2 parents a835d6a + 6d0f4fa commit d3ff01c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/libfetchers/fetchers.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@ void InputScheme::clone(
495495

496496
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying '%s' to %s...", input2.to_string(), destDir));
497497

498-
auto source = sinkToSource([&](Sink & sink) { accessor->dumpPath(CanonPath::root, sink); });
499-
500-
restorePath(destDir, *source);
498+
RestoreSink sink(/*startFsync=*/false);
499+
sink.dstPath = destDir;
500+
copyRecursive(*accessor, CanonPath::root, sink, CanonPath::root);
501501
}
502502

503503
std::optional<ExperimentalFeature> InputScheme::experimentalFeature() const

src/libutil/fs-sink.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ void copyRecursive(SourceAccessor & accessor, const CanonPath & from, FileSystem
3737
sink.createDirectory(to, [&](FileSystemObjectSink & dirSink, const CanonPath & relDirPath) {
3838
for (auto & [name, _] : accessor.readDirectory(from)) {
3939
copyRecursive(accessor, from / name, dirSink, relDirPath / name);
40-
break;
4140
}
4241
});
4342
break;

0 commit comments

Comments
 (0)