mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-07 10:47:18 +02:00
Fix error message and avoid recalculation
This commit is contained in:
parent
bc165e28ae
commit
c4ada76e86
1 changed files with 2 additions and 2 deletions
|
@ -203,8 +203,8 @@ std::optional<Hash> Input::getNarHash() const
|
||||||
if (auto s = maybeGetStrAttr(attrs, "narHash")) {
|
if (auto s = maybeGetStrAttr(attrs, "narHash")) {
|
||||||
auto hash = s->empty() ? Hash(htSHA256) : Hash::parseSRI(*s);
|
auto hash = s->empty() ? Hash(htSHA256) : Hash::parseSRI(*s);
|
||||||
if (hash.type != htSHA256)
|
if (hash.type != htSHA256)
|
||||||
throw UsageError("narHash must be specified with SRI notation");
|
throw UsageError("narHash must use SHA-256");
|
||||||
return newHashAllowEmpty(*s, htSHA256);
|
return hash;
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue