Merge pull request #5263 from greedy/fix-5261

Include subpath in flake fingerprint
This commit is contained in:
Eelco Dolstra 2021-09-17 08:10:47 +02:00 committed by GitHub
commit 37cc50f2c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -710,8 +710,9 @@ Fingerprint LockedFlake::getFingerprint() const
// and we haven't changed it, then it's sufficient to use // and we haven't changed it, then it's sufficient to use
// flake.sourceInfo.storePath for the fingerprint. // flake.sourceInfo.storePath for the fingerprint.
return hashString(htSHA256, return hashString(htSHA256,
fmt("%s;%d;%d;%s", fmt("%s;%s;%d;%d;%s",
flake.sourceInfo->storePath.to_string(), flake.sourceInfo->storePath.to_string(),
flake.lockedRef.subdir,
flake.lockedRef.input.getRevCount().value_or(0), flake.lockedRef.input.getRevCount().value_or(0),
flake.lockedRef.input.getLastModified().value_or(0), flake.lockedRef.input.getLastModified().value_or(0),
lockFile)); lockFile));