1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 17:29:36 +01:00

treewide: Add Store::requireStoreObjectAccessor, simplify uses of getFSAccessor

This is a simple wrapper around getFSAccessor that throws an InvalidPath
error. This simplifies usage in callsites that only care about getting
a non-null accessor.
This commit is contained in:
Sergei Zimmerman 2025-10-14 23:58:18 +03:00
parent 959c244a12
commit 0c32fb3fa2
No known key found for this signature in database
10 changed files with 33 additions and 22 deletions

View file

@ -1130,7 +1130,7 @@ Derivation Store::derivationFromPath(const StorePath & drvPath)
static Derivation readDerivationCommon(Store & store, const StorePath & drvPath, bool requireValidPath)
{
auto accessor = store.getFSAccessor(drvPath, requireValidPath);
auto accessor = store.requireStoreObjectAccessor(drvPath, requireValidPath);
try {
return parseDerivation(store, accessor->readFile(CanonPath::root), Derivation::nameFromPath(drvPath));
} catch (FormatError & e) {