about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/nar-info-disk-cache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libstore/nar-info-disk-cache.cc')
-rw-r--r--third_party/nix/src/libstore/nar-info-disk-cache.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/third_party/nix/src/libstore/nar-info-disk-cache.cc b/third_party/nix/src/libstore/nar-info-disk-cache.cc
index 8f723a810906..e4c4dc882ee6 100644
--- a/third_party/nix/src/libstore/nar-info-disk-cache.cc
+++ b/third_party/nix/src/libstore/nar-info-disk-cache.cc
@@ -226,10 +226,13 @@ class NarInfoDiskCacheImpl final : public NarInfoDiskCache {
           narInfo->url = queryNAR.getStr(2);
           narInfo->compression = queryNAR.getStr(3);
           if (!queryNAR.isNull(4)) {
-            narInfo->fileHash = Hash(queryNAR.getStr(4));
+            auto hash_ = Hash::deserialize(queryNAR.getStr(4));
+            // TODO(#statusor): does this throw mess with retrySQLite?
+            narInfo->fileHash = Hash::unwrap_throw(hash_);
           }
           narInfo->fileSize = queryNAR.getInt(5);
-          narInfo->narHash = Hash(queryNAR.getStr(6));
+          auto hash_ = Hash::deserialize(queryNAR.getStr(6));
+          narInfo->narHash = Hash::unwrap_throw(hash_);
           narInfo->narSize = queryNAR.getInt(7);
           for (auto r : absl::StrSplit(queryNAR.getStr(8), absl::ByChar(' '))) {
             narInfo->references.insert(absl::StrCat(cache.storeDir, "/", r));