diff options
| author | Aiden Cline <[email protected]> | 2025-12-29 15:42:26 -0600 |
|---|---|---|
| committer | Aiden Cline <[email protected]> | 2025-12-29 16:16:38 -0600 |
| commit | 02e5a1924298261234504acb4a6450506dd59034 (patch) | |
| tree | d4826dac16b1341b58549cb5ddac28a8e7c78568 | |
| parent | af967648cb9c9f7531c891e2b3046514b7afe01c (diff) | |
| download | opencode-02e5a1924298261234504acb4a6450506dd59034.tar.gz opencode-02e5a1924298261234504acb4a6450506dd59034.zip | |
tweak: adjust git watcher to ignore files other than HEAD
| -rw-r--r-- | packages/opencode/src/file/watcher.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/opencode/src/file/watcher.ts b/packages/opencode/src/file/watcher.ts index 50a310d96..b9a85bffb 100644 --- a/packages/opencode/src/file/watcher.ts +++ b/packages/opencode/src/file/watcher.ts @@ -12,6 +12,7 @@ import { lazy } from "@/util/lazy" import type ParcelWatcher from "@parcel/watcher" import { $ } from "bun" import { Flag } from "@/flag/flag" +import { readdir } from "fs/promises" declare const OPENCODE_LIBC: string | undefined @@ -78,9 +79,11 @@ export namespace FileWatcher { .text() .then((x) => path.resolve(Instance.worktree, x.trim())) if (vcsDir && !cfgIgnores.includes(".git") && !cfgIgnores.includes(vcsDir)) { + const gitDirContents = await readdir(vcsDir).catch(() => []) + const ignoreList = gitDirContents.filter((entry) => entry !== "HEAD") subs.push( await watcher().subscribe(vcsDir, subscribe, { - ignore: ["hooks", "info", "logs", "objects", "refs", "worktrees", "modules", "lfs"], + ignore: ignoreList, backend, }), ) |
