Skip to content

Commit bcfa63a

Browse files
authored
fix: allow unignoring files in .ignore (anomalyco#4814)
1 parent d40feaf commit bcfa63a

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

packages/opencode/src/file/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,16 @@ export namespace File {
276276
const project = Instance.project
277277
let ignored = (_: string) => false
278278
if (project.vcs === "git") {
279+
const ig = ignore()
279280
const gitignore = Bun.file(path.join(Instance.worktree, ".gitignore"))
280281
if (await gitignore.exists()) {
281-
const ig = ignore().add(await gitignore.text())
282-
ignored = ig.ignores.bind(ig)
282+
ig.add(await gitignore.text())
283283
}
284+
const ignoreFile = Bun.file(path.join(Instance.worktree, ".ignore"))
285+
if (await ignoreFile.exists()) {
286+
ig.add(await ignoreFile.text())
287+
}
288+
ignored = ig.ignores.bind(ig)
284289
}
285290
const resolved = dir ? path.join(Instance.directory, dir) : Instance.directory
286291
const nodes: Node[] = []

0 commit comments

Comments
 (0)