The open source coding agent.
TypeScript
core: prevent external diff tools from interfering with snapshot generation
Dax Raad0e0865540728
diff --git a/packages/opencode/src/snapshot/index.ts b/packages/opencode/src/snapshot/index.tsindex c71a1b676e9..0bbb1115e61 100644--- a/packages/opencode/src/snapshot/index.ts+++ b/packages/opencode/src/snapshot/index.ts@@ -48,7 +48,7 @@ export namespace Snapshot {const git = gitdir()await $`git --git-dir ${git} --work-tree ${Instance.worktree} add .`.quiet().cwd(Instance.directory).nothrow()const result =- await $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} diff --name-only ${hash} -- .`+ await $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --name-only ${hash} -- .`.quiet().cwd(Instance.directory).nothrow()@@ -126,7 +126,7 @@ export namespace Snapshot {const git = gitdir()await $`git --git-dir ${git} --work-tree ${Instance.worktree} add .`.quiet().cwd(Instance.directory).nothrow()const result =- await $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} diff ${hash} -- .`+ await $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff ${hash} -- .`.quiet().cwd(Instance.worktree).nothrow()@@ -159,7 +159,7 @@ export namespace Snapshot {export async function diffFull(from: string, to: string): Promise<FileDiff[]> {const git = gitdir()const result: FileDiff[] = []- for await (const line of $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-renames --numstat ${from} ${to} -- .`+ for await (const line of $`git -c core.autocrlf=false --git-dir ${git} --work-tree ${Instance.worktree} diff --no-ext-diff --no-renames --numstat ${from} ${to} -- .`.quiet().cwd(Instance.directory).nothrow()