ignore-files.ts: Fix two bugs in ignore-files.ts related to walkFilesRecursive - #4
Merged
codethief merged 2 commits intoJun 17, 2026
Conversation
walkFilesRecursive followed every symlink with statSync to decide whether to recurse into it. For a dangling symlink (target missing), statSync throws ENOENT, which propagated up and aborted the entire config load. Guard the statSync call and skip the entry on error instead. Discovered when the walk recursed into a persistent overlay's upper layer under .tuor/.state/, which contained a symlink whose target only resolved inside the sandbox and thus dangled on the host. Not descending into the state dir is a separate fix; this commit just makes the walk robust to dangling symlinks in general.
The recursive ignore-file walk started at a mount's host path and
descended into everything below it — including <configDir>/.state, where
Tuor persists overlay upper layers. That state is internal data
(serialized overlay filesystems with whiteout markers and sandbox-only
symlinks), not user content, so scanning it for .tuorignore files is both
wrong and wasteful.
Give walkFiles an excludeDirs parameter (the generic walker stays free of
Tuor-specific knowledge) and have collectIgnorePatterns exclude the state
dir, since that layer knows configDir and owns the ignore-collection
policy.
Centralize the state-dir layout (".state" / "overlays") in a new
state-dir.ts so the path isn't hardcoded in multiple places;
_getOverlayStateDir and init's .gitignore writer now derive from it too.
codethief
deleted the
fix/recursing_into_tuor_state_dir_and_following_dangling_symlinks
branch
June 17, 2026 23:01
codethief
added a commit
that referenced
this pull request
Jun 17, 2026
- Dangling symlinks would break recursion and cause exception. - Recursing into Tuor state dir was semantically incorrect (should never even be mounted in the first place).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.