mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 16:31:50 +00:00
fix: worktree file/content never includes patch
This commit is contained in:
parent
85ac243752
commit
f7ab6beaf3
1 changed files with 2 additions and 3 deletions
|
|
@ -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,
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue