1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 04:56:01 +01:00

Fix rootFS fingerprint in the impure case

This commit is contained in:
Eelco Dolstra 2025-06-16 19:34:28 +02:00
parent 5329a45ade
commit a175c67def

View file

@ -72,6 +72,18 @@ struct UnionSourceAccessor : SourceAccessor
} }
return std::nullopt; return std::nullopt;
} }
std::pair<CanonPath, std::optional<std::string>> getFingerprint(const CanonPath & path) override
{
if (fingerprint)
return {path, fingerprint};
for (auto & accessor : accessors) {
auto [subpath, fingerprint] = accessor->getFingerprint(path);
if (fingerprint)
return {subpath, fingerprint};
}
return {path, std::nullopt};
}
}; };
ref<SourceAccessor> makeUnionSourceAccessor(std::vector<ref<SourceAccessor>> && accessors) ref<SourceAccessor> makeUnionSourceAccessor(std::vector<ref<SourceAccessor>> && accessors)