Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Eelco Dolstra <edolstra@gmail.com>
- Loading branch information
1 parent
68dfb8c
commit ac2fc7b
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,7 +234,7 @@ ValidPathInfo Store::addToStoreSlow(std::string_view name, const Path & srcPath, | |
|
||
TeeSink sinkIfNar { narHashSink, caHashSink }; | ||
|
||
/* We use the tee sink if we need to hash he nar twice */ | ||
/* We use the tee sink if we need to hash the nar twice */ | ||
auto & sink = method == FileIngestionMethod::Recursive && hashAlgo != htSHA256 | ||
? static_cast<Sink &>(sinkIfNar) | ||
: narHashSink; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Ericson2314
Author
Member
|
||
|
@@ -250,7 +250,11 @@ ValidPathInfo Store::addToStoreSlow(std::string_view name, const Path & srcPath, | |
? fileSink | ||
: blank; | ||
|
||
parseDump(parseSink, tapped); | ||
parseDump( | ||
parseSink, | ||
method == FileIngestionMethod::Recursive && hashAlgo == htSHA256 | ||
? *fileSource // don't need to hash twice if we just can use the `narHash` twice | ||
: tapped); | ||
|
||
auto [narHash, narSize] = narHashSink.finish(); | ||
|
||
|
Ah!, it's only via
sink
, viatapped
, that narHashSink is changed at all.What I wrote before was the right thing all along.