diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-02 15:52:13 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2020-06-02 15:52:13 +0000 |
commit | 450dcf2c1b60a36f5ffeab2411805287d122bcdd (patch) | |
tree | d1fe49020e97198147483f42454da46f36e42094 /src/libstore/export-import.cc | |
parent | 6dd471ebf6b9a4996405398093ccb371b8abdf2f (diff) |
Remove `HashType::Unknown`
Instead, `Hash` uses `std::optional<HashType>`. In the future, we may
also make `Hash` itself require a known hash type, encoraging people to
use `std::optional<Hash>` instead.
Diffstat (limited to 'src/libstore/export-import.cc')
-rw-r--r-- | src/libstore/export-import.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/export-import.cc b/src/libstore/export-import.cc index 8a5e9d08e..e96b5610a 100644 --- a/src/libstore/export-import.cc +++ b/src/libstore/export-import.cc @@ -54,7 +54,7 @@ void Store::exportPath(const StorePath & path, Sink & sink) filesystem corruption from spreading to other machines. Don't complain if the stored hash is zero (unknown). */ Hash hash = hashAndWriteSink.currentHash(); - if (hash != info->narHash && info->narHash != Hash(info->narHash.type)) + if (hash != info->narHash && info->narHash != Hash(*info->narHash.type)) throw Error("hash of path '%s' has changed from '%s' to '%s'!", printStorePath(path), info->narHash.to_string(), hash.to_string()); |