Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/services/ripgrep/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ export async function regexSearchFiles(
throw new Error("Could not find ripgrep binary")
}

const args = ["--json", "-e", regex, "--glob", filePattern || "*", "--context", "1", "--no-messages", directoryPath]
const args = ["--json", "-e", regex]

// Only add --glob if a specific file pattern is provided
// Using --glob "*" overrides .gitignore behavior, so we omit it when no pattern is specified
if (filePattern) {
args.push("--glob", filePattern)
}

args.push("--context", "1", "--no-messages", directoryPath)

let output: string
try {
Expand Down