summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-09-04 06:09:06 -0500
committerAdam <[email protected]>2025-09-04 06:10:07 -0500
commitf7ab6beaf350bad0b3ad14c164d96ad5b181be72 (patch)
treeb3b15bcb4794e7c5688013da83ad5263e9480f99
parent85ac2437523a3dbe3a81f6698c235c5d7ec89cc2 (diff)
downloadopencode-f7ab6beaf350bad0b3ad14c164d96ad5b181be72.tar.gz
opencode-f7ab6beaf350bad0b3ad14c164d96ad5b181be72.zip
fix: worktree file/content never includes patch
-rw-r--r--packages/opencode/src/file/index.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/packages/opencode/src/file/index.ts b/packages/opencode/src/file/index.ts
index fd846444a..81f2251a9 100644
--- a/packages/opencode/src/file/index.ts
+++ b/packages/opencode/src/file/index.ts
@@ -124,10 +124,9 @@ export namespace File {
.catch(() => "")
.then((x) => x.trim())
if (project.vcs === "git") {
- const rel = path.relative(Instance.worktree, full)
- const diff = await $`git diff ${rel}`.cwd(Instance.worktree).quiet().nothrow().text()
+ const diff = await $`git diff ${file}`.cwd(Instance.directory).quiet().nothrow().text()
if (diff.trim()) {
- const original = await $`git show HEAD:${rel}`.cwd(Instance.worktree).quiet().nothrow().text()
+ const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
const patch = createPatch(file, original, content, "old", "new", {
context: Infinity,
})