1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

Add tests for read-only local store

Make sure we don't go down the path of making temproots when doing
operations on a read-only store
This commit is contained in:
cidkidnix 2023-05-17 13:48:59 -05:00 committed by Ben Radford
parent 5966b76c97
commit 85a2453052
3 changed files with 35 additions and 1 deletions

View file

@ -110,6 +110,10 @@ void LocalStore::createTempRootsFile()
void LocalStore::addTempRoot(const StorePath & path)
{
if (readOnly) {
debug("Read-only store doesn't support creating lock files for temp roots, but nothing can be deleted anyways.");
return;
}
createTempRootsFile();
/* Open/create the global GC lock file. */