mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
don't assume that rev is a SHA1 hash
This was a problem when writing a fetcher that uses e.g. sha256 hashes for revisions. This doesn't actually do anything new, but allows for creating such fetchers in the future (perhaps when support for Git's SHA256 object format gains more popularity).
This commit is contained in:
parent
f01e33f283
commit
2c2fd4946f
3 changed files with 13 additions and 6 deletions
|
@ -155,7 +155,7 @@ static std::pair<std::optional<HashType>, bool> getParsedTypeAndSRI(std::string_
|
|||
{
|
||||
bool isSRI = false;
|
||||
|
||||
// Parse the has type before the separater, if there was one.
|
||||
// Parse the hash type before the separator, if there was one.
|
||||
std::optional<HashType> optParsedType;
|
||||
{
|
||||
auto hashRaw = splitPrefixTo(rest, ':');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue