Ver código fonte

fix: use realpath consistently for init/dispose and drop unnecessary fsmonitor flag on git show

LukeParkerDev 5 meses atrás
pai
commit
73a9c26fe9

+ 1 - 5
packages/opencode/src/file/index.ts

@@ -550,11 +550,7 @@ export namespace File {
           .text()
       }
       if (diff.trim()) {
-        const original = await $`git -c core.fsmonitor=false show HEAD:${file}`
-          .cwd(Instance.directory)
-          .quiet()
-          .nothrow()
-          .text()
+        const original = await $`git show HEAD:${file}`.cwd(Instance.directory).quiet().nothrow().text()
         const patch = structuredPatch(file, file, original, content, "old", "new", {
           context: Infinity,
           ignoreWhitespace: true,

+ 1 - 1
packages/opencode/test/fixture/fixture.ts

@@ -53,8 +53,8 @@ export async function tmpdir<T>(options?: TmpDirOptions<T>) {
       }),
     )
   }
-  const extra = await options?.init?.(dirpath)
   const realpath = sanitizePath(await fs.realpath(dirpath))
+  const extra = await options?.init?.(realpath)
   const result = {
     [Symbol.asyncDispose]: async () => {
       try {