diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 21:58:27 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-18 22:11:19 +0000 |
commit | bbbf3602a323538b8da38f1a2c7ce136a20f74c6 (patch) | |
tree | e783d838d8a75d854e0b72eea03784c5909040bc /src/libfetchers/fetchers.cc | |
parent | 406dbb7fce32f7d80b02f560d91c956698b58d6e (diff) | |
parent | 40526fbea56a8006eb7f1758d461a5acbe9a1694 (diff) |
Merge branch 'enum-class' into no-hash-type-unknown
Diffstat (limited to 'src/libfetchers/fetchers.cc')
-rw-r--r-- | src/libfetchers/fetchers.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libfetchers/fetchers.cc b/src/libfetchers/fetchers.cc index a13533c3c..02fafc65b 100644 --- a/src/libfetchers/fetchers.cc +++ b/src/libfetchers/fetchers.cc @@ -36,7 +36,7 @@ std::unique_ptr<Input> inputFromAttrs(const Attrs & attrs) if (res) { if (auto narHash = maybeGetStrAttr(attrs, "narHash")) // FIXME: require SRI hash. - res->narHash = Hash(*narHash); + res->narHash = newHashAllowEmpty(*narHash, {}); return res; } } @@ -47,7 +47,7 @@ Attrs Input::toAttrs() const { auto attrs = toAttrsInternal(); if (narHash) - attrs.emplace("narHash", narHash->to_string(Base::SRI)); + attrs.emplace("narHash", narHash->to_string(Base::SRI, true)); attrs.emplace("type", type()); return attrs; } @@ -67,7 +67,7 @@ std::pair<Tree, std::shared_ptr<const Input>> Input::fetchTree(ref<Store> store) if (narHash && narHash != input->narHash) throw Error("NAR hash mismatch in input '%s' (%s), expected '%s', got '%s'", - to_string(), tree.actualPath, narHash->to_string(Base::SRI), input->narHash->to_string(Base::SRI)); + to_string(), tree.actualPath, narHash->to_string(Base::SRI, true), input->narHash->to_string(Base::SRI, true)); return {std::move(tree), input}; } |