diff options
| author | Shantur Rathore <[email protected]> | 2026-02-19 20:17:36 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-19 14:17:36 -0600 |
| commit | 190d2957eb34246ac942b1e082ea79fd151ea973 (patch) | |
| tree | 3e7278eab77ac65e809571db72d56d92a2be72cc /packages | |
| parent | b64d0768baac8066b5002c2e31a5afe8687bdf3b (diff) | |
| download | opencode-190d2957eb34246ac942b1e082ea79fd151ea973.tar.gz opencode-190d2957eb34246ac942b1e082ea79fd151ea973.zip | |
fix(core): normalize file.status paths relative to instance dir (#14207)
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/opencode/src/file/index.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/opencode/src/file/index.ts b/packages/opencode/src/file/index.ts index d1d24c364..b7daddc5f 100644 --- a/packages/opencode/src/file/index.ts +++ b/packages/opencode/src/file/index.ts @@ -482,10 +482,13 @@ export namespace File { } } - return changedFiles.map((x) => ({ - ...x, - path: path.relative(Instance.directory, x.path), - })) + return changedFiles.map((x) => { + const full = path.isAbsolute(x.path) ? x.path : path.join(Instance.directory, x.path) + return { + ...x, + path: path.relative(Instance.directory, full), + } + }) } export async function read(file: string): Promise<Content> { |
