about summary refs log tree commit diff
path: root/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc')
-rw-r--r--third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc b/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc
index 0e5b2ec8a5..644df1dba2 100644
--- a/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc
+++ b/third_party/nix/src/nix-prefetch-url/nix-prefetch-url.cc
@@ -167,7 +167,8 @@ static int _main(int argc, char** argv) {
     Hash expectedHash(ht);
     Path storePath;
     if (args.size() == 2) {
-      expectedHash = Hash(args[1], ht);
+      auto expectedHash_ = Hash::deserialize(args[1], ht);
+      expectedHash = Hash::unwrap_throw(expectedHash);
       storePath = store->makeFixedOutputPath(unpack, expectedHash, name);
       if (store->isValidPath(storePath)) {
         hash = expectedHash;