Explorar el Código

fix: file read response

Adam hace 7 meses
padre
commit
8ffedbe157
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      packages/opencode/src/file/index.ts

+ 2 - 2
packages/opencode/src/file/index.ts

@@ -156,10 +156,10 @@ export namespace File {
       const diff = await $`git diff ${file}`.cwd(Instance.directory).quiet().nothrow().text()
       const diff = await $`git diff ${file}`.cwd(Instance.directory).quiet().nothrow().text()
       if (diff.trim()) {
       if (diff.trim()) {
         const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
         const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
-        const diff = structuredPatch(file, file, original, content, "old", "new", {
+        const patch = structuredPatch(file, file, original, content, "old", "new", {
           context: Infinity,
           context: Infinity,
         })
         })
-        const patch = formatPatch(diff)
+        const diff = formatPatch(patch)
         return { content, patch, diff }
         return { content, patch, diff }
       }
       }
     }
     }