1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 23:12:44 +01:00

Merge pull request #10467 from edolstra/nix-shell-symlink

nix shell: Handle output paths that are symlinks
This commit is contained in:
Théophane Hufschmitt 2024-04-16 12:31:14 +02:00 committed by GitHub
commit d2a07a96ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 108 additions and 72 deletions

View file

@ -33,6 +33,10 @@ struct LocalStoreAccessor : PosixSourceAccessor
std::optional<Stat> maybeLstat(const CanonPath & path) override
{
/* Handle the case where `path` is (a parent of) the store. */
if (isDirOrInDir(store->storeDir, path.abs()))
return Stat{ .type = tDirectory };
return PosixSourceAccessor::maybeLstat(toRealPath(path));
}