fs: fix glob early return skipping sibling entries · nodejs/node@74dcdbb · GitHub
Skip to content

Commit 74dcdbb

Browse files
webdevelopersrinusemimikoh
authored andcommitted
fs: fix glob early return skipping sibling entries
The children loop in the glob traversal returned from the whole method when a child path had already been seen through a different pattern context, silently dropping the remaining sibling entries. Whether this triggered depended on directory iteration order, which also made test-fs-glob.mjs flaky. Remove the check: the cache.add call at the start of the traversal already prevents reprocessing. Fixes: #62897 Co-authored-by: semimikoh <ejffjeosms@gmail.com> Signed-off-by: webdevelopersrinu <webdeveloper.srinu9@gmail.com> PR-URL: #64895 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 9139389 commit 74dcdbb

2 files changed

Lines changed: 76 additions & 6 deletions

File tree

lib/internal/fs/glob.js

Lines changed: 0 additions & 6 deletions

test/parallel/test-fs-glob.mjs

Lines changed: 76 additions & 0 deletions

0 commit comments

Comments
 (0)