aboutsummaryrefslogtreecommitdiff
path: root/src/nix/prefetch.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/prefetch.cc')
-rw-r--r--src/nix/prefetch.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc
index 039608d48..3b2e225f6 100644
--- a/src/nix/prefetch.cc
+++ b/src/nix/prefetch.cc
@@ -70,7 +70,13 @@ std::tuple<StorePath, Hash> prefetchFile(
the store. */
if (expectedHash) {
hashType = expectedHash->type;
- storePath = store->makeFixedOutputPath(ingestionMethod, *expectedHash, *name);
+ storePath = store->makeFixedOutputPath(*name, FixedOutputInfo {
+ .hash = {
+ .method = ingestionMethod,
+ .hash = *expectedHash,
+ },
+ .references = {},
+ });
if (store->isValidPath(*storePath))
hash = expectedHash;
else
@@ -121,7 +127,7 @@ std::tuple<StorePath, Hash> prefetchFile(
auto info = store->addToStoreSlow(*name, tmpFile, ingestionMethod, hashType, expectedHash);
storePath = info.path;
assert(info.ca);
- hash = getContentAddressHash(*info.ca);
+ hash = info.ca->getHash();
}
return {storePath.value(), hash.value()};