summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/opencode/src/file/index.ts11
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> {