Skip to content

Commit b697e69

Browse files
daniel-lxsPrasangAPrajapati
authored andcommitted
fix: respect nested .gitignore files in search_files (RooCodeInc#8804)
1 parent 21442a0 commit b697e69

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/services/ripgrep/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,15 @@ export async function regexSearchFiles(
150150
throw new Error("Could not find ripgrep binary")
151151
}
152152

153-
const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", "--no-messages", directoryPath]
153+
const args = ["--json", "-e", regex]
154+
155+
// Only add --glob if a specific file pattern is provided
156+
// Using --glob "*" overrides .gitignore behavior, so we omit it when no pattern is specified
157+
if (filePattern) {
158+
args.push("--glob", filePattern)
159+
}
160+
161+
args.push("--context", "1", "--no-messages", directoryPath)
154162

155163
let output: string
156164
try {

0 commit comments

Comments
 (0)