mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Remove HashType::Unknown
Instead, `Hash` uses `std::optional<HashType>`. In the future, we may also make `Hash` itself require a known hash type, encoraging people to use `std::optional<Hash>` instead.
This commit is contained in:
parent
6dd471ebf6
commit
450dcf2c1b
14 changed files with 72 additions and 53 deletions
|
@ -3726,8 +3726,8 @@ void DerivationGoal::registerOutputs()
|
|||
/* Check the hash. In hash mode, move the path produced by
|
||||
the derivation to its content-addressed location. */
|
||||
Hash h2 = outputHashMode == FileIngestionMethod::Recursive
|
||||
? hashPath(h.type, actualPath).first
|
||||
: hashFile(h.type, actualPath);
|
||||
? hashPath(*h.type, actualPath).first
|
||||
: hashFile(*h.type, actualPath);
|
||||
|
||||
auto dest = worker.store.makeFixedOutputPath(outputHashMode, h2, i.second.path.name());
|
||||
|
||||
|
@ -4999,7 +4999,7 @@ bool Worker::pathContentsGood(const StorePath & path)
|
|||
if (!pathExists(store.printStorePath(path)))
|
||||
res = false;
|
||||
else {
|
||||
HashResult current = hashPath(info->narHash.type, store.printStorePath(path));
|
||||
HashResult current = hashPath(*info->narHash.type, store.printStorePath(path));
|
||||
Hash nullHash(HashType::SHA256);
|
||||
res = info->narHash == nullHash || info->narHash == current.first;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue