Only allow reference lock files when allow-dirty is set

This commit is contained in:
Linus Heckemann 2023-03-19 14:12:49 +01:00
parent ea207a2eed
commit f1c9d83697

View file

@ -334,6 +334,9 @@ LockedFlake lockFlake(
} }
try { try {
if (!fetchSettings.allowDirty && lockFlags.referenceLockFilePath) {
throw Error("reference lock file was provided, but the `allow-dirty` setting is set to false");
}
// FIXME: symlink attack // FIXME: symlink attack
auto oldLockFile = LockFile::read( auto oldLockFile = LockFile::read(