Skip to content

Commit

Permalink
Fixup bad rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewbauer committed Jun 2, 2020
1 parent b120259 commit 4167aaa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/libstore/local-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
9 changes: 3 additions & 6 deletions src/libutil/git.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ typedef std::map<string, std::pair<GitMode, Hash>> GitTree;
GitMode dumpGitTree(const GitTree & entries, Sink & sink);

// Recursively dumps path, hashing as we go
Hash dumpGitHash(
std::function<std::unique_ptr<AbstractHashSink>()>,
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.
}
13 changes: 5 additions & 8 deletions src/nix/hash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ struct CmdHash : Command
{
for (auto path : paths) {

auto makeHashSink = [&]() -> std::unique_ptr<AbstractHashSink> {
std::unique_ptr<AbstractHashSink> t;
if (modulus)
t = std::make_unique<HashModuloSink>(ht, *modulus);
else
t = std::make_unique<HashSink>(ht);
return t;
};
std::unique_ptr<AbstractHashSink> hashSink;
if (modulus)
hashSink = std::make_unique<HashModuloSink>(ht, *modulus);
else
hashSink = std::make_unique<HashSink>(ht);

Hash h;
switch (mode) {
Expand Down

0 comments on commit 4167aaa

Please sign in to comment.