1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 06:52:43 +01:00

ValidPathInfo::isContentAddressed(): Ensure there are no references

(cherry picked from commit 9d1220a01d)
This commit is contained in:
Eelco Dolstra 2018-03-28 21:49:09 +02:00
parent 59c54f877c
commit 247630287b
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -765,7 +765,8 @@ bool ValidPathInfo::isContentAddressed(const Store & store) const
else if (hasPrefix(ca, "fixed:")) {
bool recursive = ca.compare(6, 2, "r:") == 0;
Hash hash(std::string(ca, recursive ? 8 : 6));
if (store.makeFixedOutputPath(recursive, hash, storePathToName(path)) == path)
if (references.empty() &&
store.makeFixedOutputPath(recursive, hash, storePathToName(path)) == path)
return true;
else
warn();