1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

Crudely make addToStoreFromDump take Source not string

I just as little beyond the type as possible, so the implementation
changes this enables can be reviewed separately.
This commit is contained in:
John Ericson 2020-07-11 15:55:04 +00:00
parent 9ec10046e0
commit c86fc3a965
5 changed files with 11 additions and 5 deletions

View file

@ -1033,9 +1033,12 @@ void LocalStore::addToStore(const ValidPathInfo & info, Source & source,
}
StorePath LocalStore::addToStoreFromDump(const string & dump, const string & name,
StorePath LocalStore::addToStoreFromDump(Source & dumpSource, const string & name,
FileIngestionMethod method, HashType hashAlgo, RepairFlag repair)
{
// FIXME: See if we can use the original source to reduce memory usage.
auto dump = dumpSource.drain();
Hash h = hashString(hashAlgo, dump);
auto dstPath = makeFixedOutputPath(method, h, name);