summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-01-30 23:38:43 -0600
committerGitHub <[email protected]>2026-01-30 23:38:43 -0600
commitc0e71c4261d0d23a9f24064c7b2094c207c25d2f (patch)
tree8528a48eec99fee454e9536361e2aeba82c7310c
parent507f13a30ce986208a84e4e207d776f0f451b46b (diff)
downloadopencode-c0e71c4261d0d23a9f24064c7b2094c207c25d2f.tar.gz
opencode-c0e71c4261d0d23a9f24064c7b2094c207c25d2f.zip
fix: don't --follow by default for grep and other things using ripgrep (#11415)
-rw-r--r--packages/opencode/src/file/ripgrep.ts6
-rw-r--r--packages/opencode/src/tool/grep.ts10
2 files changed, 4 insertions, 12 deletions
diff --git a/packages/opencode/src/file/ripgrep.ts b/packages/opencode/src/file/ripgrep.ts
index 0f6889779..dd94cc609 100644
--- a/packages/opencode/src/file/ripgrep.ts
+++ b/packages/opencode/src/file/ripgrep.ts
@@ -214,8 +214,8 @@ export namespace Ripgrep {
input.signal?.throwIfAborted()
const args = [await filepath(), "--files", "--glob=!.git/*"]
- if (input.follow !== false) args.push("--follow")
- if (input.hidden !== false) args.push("--hidden")
+ if (input.follow) args.push("--follow")
+ if (input.hidden) args.push("--hidden")
if (input.maxDepth !== undefined) args.push(`--max-depth=${input.maxDepth}`)
if (input.glob) {
for (const g of input.glob) {
@@ -381,7 +381,7 @@ export namespace Ripgrep {
follow?: boolean
}) {
const args = [`${await filepath()}`, "--json", "--hidden", "--glob='!.git/*'"]
- if (input.follow !== false) args.push("--follow")
+ if (input.follow) args.push("--follow")
if (input.glob) {
for (const g of input.glob) {
diff --git a/packages/opencode/src/tool/grep.ts b/packages/opencode/src/tool/grep.ts
index 6cb70d022..c10b4dfb8 100644
--- a/packages/opencode/src/tool/grep.ts
+++ b/packages/opencode/src/tool/grep.ts
@@ -37,15 +37,7 @@ export const GrepTool = Tool.define("grep", {
await assertExternalDirectory(ctx, searchPath, { kind: "directory" })
const rgPath = await Ripgrep.filepath()
- const args = [
- "-nH",
- "--hidden",
- "--follow",
- "--no-messages",
- "--field-match-separator=|",
- "--regexp",
- params.pattern,
- ]
+ const args = ["-nH", "--hidden", "--no-messages", "--field-match-separator=|", "--regexp", params.pattern]
if (params.include) {
args.push("--glob", params.include)
}