From 4167aaa858a7fc7f60a4bcebd622e089bb73f392 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 1 Jun 2020 19:06:55 -0500 Subject: [PATCH] Fixup bad rebase --- src/libstore/local-store.cc | 2 +- src/libutil/git.hh | 9 +++------ src/nix/hash.cc | 13 +++++-------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index b742857ccbbc..14c816e72822 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1132,7 +1132,7 @@ StorePath LocalStore::addToStore(const string & name, const Path & _srcPath, small files. */ StringSink sink; switch (method) { - case FileIngestionMethod::Recursive: + case FileIngestionMethod::Recursive: { dumpPath(srcPath, sink, filter); break; } diff --git a/src/libutil/git.hh b/src/libutil/git.hh index 1d773d3750fc..06a56d55b708 100644 --- a/src/libutil/git.hh +++ b/src/libutil/git.hh @@ -25,11 +25,8 @@ typedef std::map> GitTree; GitMode dumpGitTree(const GitTree & entries, Sink & sink); // Recursively dumps path, hashing as we go -Hash dumpGitHash( - std::function()>, - const Path & path, - PathFilter & filter = defaultPathFilter); +Hash dumpGitHash(HashType ht, const Path & path, PathFilter & filter = defaultPathFilter); + +void dumpGit(HashType ht, const Path & path, Sink & sink, PathFilter & filter = defaultPathFilter); -// N.B. There is no way to recursively dump to a sink, as that doesn't make -// sense with the git hash/data model where the information is Merklized. } diff --git a/src/nix/hash.cc b/src/nix/hash.cc index 3a8c82da17bf..c738a85aa00b 100644 --- a/src/nix/hash.cc +++ b/src/nix/hash.cc @@ -57,14 +57,11 @@ struct CmdHash : Command { for (auto path : paths) { - auto makeHashSink = [&]() -> std::unique_ptr { - std::unique_ptr t; - if (modulus) - t = std::make_unique(ht, *modulus); - else - t = std::make_unique(ht); - return t; - }; + std::unique_ptr hashSink; + if (modulus) + hashSink = std::make_unique(ht, *modulus); + else + hashSink = std::make_unique(ht); Hash h; switch (mode) {