fix nix edit in pure mode

FilteringSourceAccessor was not delegating getPhysicalPath to its inner accessor.
This commit is contained in:
Jörg Thalheim 2024-05-31 10:38:55 +02:00
parent ef5c846e25
commit e1a817fb1b
2 changed files with 8 additions and 0 deletions

View file

@ -2,6 +2,12 @@
namespace nix { namespace nix {
std::optional<std::filesystem::path> FilteringSourceAccessor::getPhysicalPath(const CanonPath & path)
{
checkAccess(path);
return next->getPhysicalPath(prefix / path);
}
std::string FilteringSourceAccessor::readFile(const CanonPath & path) std::string FilteringSourceAccessor::readFile(const CanonPath & path)
{ {
checkAccess(path); checkAccess(path);

View file

@ -30,6 +30,8 @@ struct FilteringSourceAccessor : SourceAccessor
displayPrefix.clear(); displayPrefix.clear();
} }
std::optional<std::filesystem::path> getPhysicalPath(const CanonPath & path) override;
std::string readFile(const CanonPath & path) override; std::string readFile(const CanonPath & path) override;
bool pathExists(const CanonPath & path) override; bool pathExists(const CanonPath & path) override;