diff options
| author | Dalton Alexandre <[email protected]> | 2025-12-02 15:15:12 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-02 17:15:12 -0600 |
| commit | bcfa63aa4e247f023e2c1ad156df074d362f7e4d (patch) | |
| tree | fa812d6cf6f1f9ecaf70d9bb3dd0633484d59ef7 | |
| parent | d40feafb016d1443ff61578c98e2647ebcc5fe40 (diff) | |
| download | opencode-bcfa63aa4e247f023e2c1ad156df074d362f7e4d.tar.gz opencode-bcfa63aa4e247f023e2c1ad156df074d362f7e4d.zip | |
fix: allow unignoring files in .ignore (#4814)
| -rw-r--r-- | packages/opencode/src/file/index.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/packages/opencode/src/file/index.ts b/packages/opencode/src/file/index.ts index aae7061c1..51934a235 100644 --- a/packages/opencode/src/file/index.ts +++ b/packages/opencode/src/file/index.ts @@ -276,11 +276,16 @@ export namespace File { const project = Instance.project let ignored = (_: string) => false if (project.vcs === "git") { + const ig = ignore() const gitignore = Bun.file(path.join(Instance.worktree, ".gitignore")) if (await gitignore.exists()) { - const ig = ignore().add(await gitignore.text()) - ignored = ig.ignores.bind(ig) + ig.add(await gitignore.text()) } + const ignoreFile = Bun.file(path.join(Instance.worktree, ".ignore")) + if (await ignoreFile.exists()) { + ig.add(await ignoreFile.text()) + } + ignored = ig.ignores.bind(ig) } const resolved = dir ? path.join(Instance.directory, dir) : Instance.directory const nodes: Node[] = [] |
