Skip to content

Commit c9da396

Browse files
committed
fix: update buildRecursiveArgs to avoid parent direction ignore match
1 parent c52fdc4 commit c9da396

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/services/glob/list-files.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -270,19 +270,9 @@ function buildRecursiveArgs(dirPath: string): string[] {
270270
continue
271271
}
272272

273-
// When explicitly targeting a directory that's in the ignore list (e.g., "temp"),
274-
// we need special handling:
275-
// - Don't add any exclusion pattern for the target directory itself
276-
// - Only exclude nested subdirectories with the same name
277-
// This ensures all files in the target directory are listed, while still
278-
// preventing recursion into nested directories with the same ignored name
279-
if (dir === targetDirName && isTargetInIgnoreList) {
280-
// Skip adding any exclusion pattern - we want to see everything in the target directory
281-
continue
282-
}
283-
284-
// For all other cases, exclude the directory pattern globally
285-
args.push("-g", `!**/${dir}/**`)
273+
// For all other cases, all children only
274+
args.push("-g", `!${dir}`)
275+
args.push("-g", `!${dir}/**`)
286276
}
287277

288278
return args

0 commit comments

Comments
 (0)