From d8a34c2fcc6e36a831d6d340aae63d12ec69b73f Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Fri, 19 Dec 2025 13:15:11 -0500 Subject: [PATCH] core: prevent file system scanning when in root directory to avoid unnecessary operations --- packages/opencode/src/file/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/opencode/src/file/index.ts b/packages/opencode/src/file/index.ts index 61630ff1c..19eda49ca 100644 --- a/packages/opencode/src/file/index.ts +++ b/packages/opencode/src/file/index.ts @@ -125,6 +125,8 @@ export namespace File { let cache: Entry = { files: [], dirs: [] } let fetching = false const fn = async (result: Entry) => { + // Disable scanning if in root of file system + if (Instance.directory === path.parse(Instance.directory).root) return fetching = true const set = new Set() for await (const file of Ripgrep.files({ cwd: Instance.directory })) {