1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 06:31:14 +02:00

UnionSourceAccessor: Don't filter out underlying files of the wrong type

https://github.com/NixOS/nix/pull/12512#discussion_r1961567140
This commit is contained in:
Eelco Dolstra 2025-02-19 13:34:42 +01:00
parent 99e78c37f7
commit 584ddd1b4d
2 changed files with 3 additions and 4 deletions

View file

@ -1,5 +1,4 @@
#include "eval.hh"
#include "store-api.hh"
namespace nix {

View file

@ -16,7 +16,7 @@ struct UnionSourceAccessor : SourceAccessor
{
for (auto & accessor : accessors) {
auto st = accessor->maybeLstat(path);
if (st && st->type == Type::tRegular)
if (st)
return accessor->readFile(path);
}
throw FileNotFound("path '%s' does not exist", showPath(path));
@ -37,7 +37,7 @@ struct UnionSourceAccessor : SourceAccessor
DirEntries result;
for (auto & accessor : accessors) {
auto st = accessor->maybeLstat(path);
if (!st || st->type != Type::tDirectory)
if (!st)
continue;
for (auto & entry : accessor->readDirectory(path))
// Don't override entries from previous accessors.
@ -50,7 +50,7 @@ struct UnionSourceAccessor : SourceAccessor
{
for (auto & accessor : accessors) {
auto st = accessor->maybeLstat(path);
if (st && st->type == Type::tSymlink)
if (st)
return accessor->readLink(path);
}
throw FileNotFound("path '%s' does not exist", showPath(path));