1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Merge pull request #14249 from NixOS/more-to-real-path-cleanups

More toRealPath cleanups
This commit is contained in:
John Ericson 2025-10-14 22:46:15 +00:00 committed by GitHub
commit 6dcc468253
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 47 additions and 38 deletions

View file

@ -588,7 +588,11 @@ static void fetch(
if (expectedHash) {
auto hash = unpack ? state.store->queryPathInfo(storePath)->narHash
: hashFile(HashAlgorithm::SHA256, state.store->toRealPath(storePath));
: hashPath(
{state.store->requireStoreObjectAccessor(storePath)},
FileSerialisationMethod::Flat,
HashAlgorithm::SHA256)
.hash;
if (hash != *expectedHash) {
state
.error<EvalError>(