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

This commit is contained in:
Eelco Dolstra 2018-03-28 21:49:09 +02:00
parent e01c01f72c
commit 9d1220a01d
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -757,7 +757,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();