test(cleaner): cover exclusions surviving a directory-level delete - #267
Merged
Conversation
Descending the recency check closed a second gap worth pinning down. The old top-level scan only tested the entries it listed, so a directory could be offered as one item and then recursively deleted along with an excluded file buried inside it. An excluded descendant now blocks the collapse, so only its settled siblings are offered.
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.
Follow-up to #266, which merged while I was writing these.
Reviewing the descending recency check afterwards turned up a second property it establishes, separate from the one the PR was about and worth pinning down.
The old top-level scan tested only the entries it listed, so
isExcludednever saw anything below the first level. A directory could therefore be offered as a single item and then recursively deleted along with an excluded file buried inside it — the exclusion was honoured when choosing what to list, and then quietly bypassed by therm -rthat followed.Descending closes that off as a side effect: an excluded descendant makes the subtree incomplete, so the directory is never collapsed and only its settled, non-excluded siblings are offered.
Two tests, one for a full-path exclusion and one for an
*.extglob below the top level. Both fail against the pre-#266 behaviour and pass now — this is coverage for something already fixed, not a new change.Tests only, no production code touched. 2352 passing.