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

Merge branch 'path-info' into ca-drv-exotic

This commit is contained in:
John Ericson 2023-01-06 15:37:31 -05:00
commit 81727f85cb
17 changed files with 153 additions and 119 deletions

View file

@ -161,15 +161,15 @@ std::string renderContentAddress(std::optional<ContentAddress> ca)
}
ContentAddressWithReferences contentAddressFromMethodHashAndRefs(
ContentAddressMethod method, Hash && hash, PathReferences<StorePath> && refs)
ContentAddressMethod method, Hash && hash, StoreReferences && refs)
{
return std::visit(overloaded {
[&](TextHashMethod _) -> ContentAddressWithReferences {
if (refs.hasSelfReference)
if (refs.self)
throw UsageError("Cannot have a self reference with text hashing scheme");
return TextInfo {
{ .hash = std::move(hash) },
std::move(refs.references),
.references = std::move(refs.others),
};
},
[&](FileIngestionMethod m2) -> ContentAddressWithReferences {
@ -178,7 +178,7 @@ ContentAddressWithReferences contentAddressFromMethodHashAndRefs(
.method = m2,
.hash = std::move(hash),
},
std::move(refs),
.references = std::move(refs),
};
},
}, method);