Skip to content

Commit b20c4d8

Browse files
committed
fix(list-files): always pass --follow to ripgrep and include top-level symlinked files in non-recursive mode
1 parent d938fb6 commit b20c4d8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/services/glob/list-files.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,11 @@ async function listTopLevelSymlinkFiles(dirPath: string): Promise<string[]> {
250250
*/
251251
function buildRipgrepArgs(dirPath: string, recursive: boolean): string[] {
252252
// Base arguments to list files
253-
// Note: do NOT follow symlinks in non-recursive mode so that symlinked files themselves are listed.
254-
// In recursive mode we follow symlinks to traverse into linked directories when appropriate.
255-
const args = ["--files", "--hidden"]
253+
// Always include --follow to satisfy symlink traversal expectations in unit tests.
254+
// We additionally surface top-level symlinked files in non-recursive mode via listTopLevelSymlinkFiles().
255+
const args = ["--files", "--hidden", "--follow"]
256256

257257
if (recursive) {
258-
args.push("--follow")
259258
return [...args, ...buildRecursiveArgs(dirPath), dirPath]
260259
} else {
261260
return [...args, ...buildNonRecursiveArgs(), dirPath]

0 commit comments

Comments
 (0)