aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/content-address.cc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-02 23:30:38 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-06-03 04:44:24 +0000
commit3c78ac348c3a32fa6d78d3c56645901513c2e731 (patch)
treeb4ff0079484b825f884eb98ff88655142d386f58 /src/libstore/content-address.cc
parentfecff16a6e8bffce9a404b1508fec375e83ec01e (diff)
parent406dbb7fce32f7d80b02f560d91c956698b58d6e (diff)
Merge remote-tracking branch 'obsidian/no-hash-type-unknown' into validPathInfo-ca-proper-datatype
Diffstat (limited to 'src/libstore/content-address.cc')
-rw-r--r--src/libstore/content-address.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/content-address.cc b/src/libstore/content-address.cc
index 718c7ffc3..f30f53ff8 100644
--- a/src/libstore/content-address.cc
+++ b/src/libstore/content-address.cc
@@ -3,7 +3,7 @@
namespace nix {
std::string FileSystemHash::printMethodAlgo() const {
- return makeFileIngestionPrefix(method) + printHashType(hash.type);
+ return makeFileIngestionPrefix(method) + printHashType(*hash.type);
}
std::string makeFileIngestionPrefix(const FileIngestionMethod m) {
@@ -46,7 +46,7 @@ ContentAddress parseContentAddress(std::string_view rawCa) {
if (prefix == "text") {
auto hashTypeAndHash = rawCa.substr(prefixSeparator+1, string::npos);
Hash hash = Hash(string(hashTypeAndHash));
- if (hash.type != HashType::SHA256) {
+ if (*hash.type != HashType::SHA256) {
throw Error("parseContentAddress: the text hash should have type SHA256");
}
return TextHash { hash };