aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/derivations.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-19 20:22:36 +0200
committerGitHub <noreply@github.com>2020-06-19 20:22:36 +0200
commit984e521392b3f41f7cdab203e5c00f3e00e27a28 (patch)
treec63ca1c6b5d879a60b985bfa04f03b065d407594 /src/libstore/derivations.cc
parent424bb5819f736af7413c343d462663474222eaac (diff)
parent68294746aeb1d23d2859e5ccc1a0c971cd7d5120 (diff)
Merge pull request #3650 from obsidiansystems/no-hash-type-unknown
Remove `HashType::htUnknown`
Diffstat (limited to 'src/libstore/derivations.cc')
-rw-r--r--src/libstore/derivations.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index 528b7ccea..a79b78db6 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -9,7 +9,7 @@
namespace nix {
std::string DerivationOutputHash::printMethodAlgo() const {
- return makeFileIngestionPrefix(method) + printHashType(hash.type);
+ return makeFileIngestionPrefix(method) + printHashType(*hash.type);
}
@@ -121,8 +121,6 @@ static DerivationOutput parseDerivationOutput(const Store & store, istringstream
hashAlgo = string(hashAlgo, 2);
}
const HashType hashType = parseHashType(hashAlgo);
- if (hashType == htUnknown)
- throw Error("unknown hash hashAlgorithm '%s'", hashAlgo);
fsh = DerivationOutputHash {
.method = std::move(method),
.hash = Hash(hash, hashType),
@@ -421,8 +419,6 @@ static DerivationOutput readDerivationOutput(Source & in, const Store & store)
hashAlgo = string(hashAlgo, 2);
}
const HashType hashType = parseHashType(hashAlgo);
- if (hashType == htUnknown)
- throw Error("unknown hash hashAlgorithm '%s'", hashAlgo);
fsh = DerivationOutputHash {
.method = std::move(method),
.hash = Hash(hash, hashType),