Skip to content

Commit 5324f6a

Browse files
committed
fix(git): disable external diff for review diff previews
With diff.external configured, git diff delegates to that tool instead of emitting a unified patch, so the Diff panel cannot parse it and falls back to "Unsupported diff format. Showing raw patch." That is #927. #927 was closed by #2553, which added --no-ext-diff to prepareCommitContext and readRangeContext, and #2586 had already added it to the checkpoint diff. Neither covered getReviewDiffPreview, which backs the Working tree and Branch scopes, so those two still route through the external tool. Adds --no-color --no-ext-diff --no-textconv to the three remaining call sites: the tracked working-tree diff, the base...HEAD branch diff, and the --no-index untracked file diffs.
1 parent d19039a commit 5324f6a

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

‎apps/server/src/vcs/GitVcsDriverCore.ts‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,18 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
20012001
executeGit(
20022002
"GitVcsDriver.readUntrackedReviewDiffs.diff",
20032003
cwd,
2004-
["diff", "--no-index", "--patch", "--minimal", "--", "/dev/null", relativePath],
2004+
[
2005+
"diff",
2006+
"--no-index",
2007+
"--patch",
2008+
"--no-color",
2009+
"--no-ext-diff",
2010+
"--no-textconv",
2011+
"--minimal",
2012+
"--",
2013+
"/dev/null",
2014+
relativePath,
2015+
],
20052016
{
20062017
allowNonZeroExit: true,
20072018
maxOutputBytes: REVIEW_UNTRACKED_DIFF_MAX_OUTPUT_BYTES,
@@ -2046,6 +2057,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
20462057
[
20472058
"diff",
20482059
"--patch",
2060+
"--no-color",
2061+
"--no-ext-diff",
2062+
"--no-textconv",
20492063
"--minimal",
20502064
...(input.ignoreWhitespace ? ["--ignore-all-space"] : []),
20512065
"HEAD",
@@ -2079,6 +2093,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
20792093
[
20802094
"diff",
20812095
"--patch",
2096+
"--no-color",
2097+
"--no-ext-diff",
2098+
"--no-textconv",
20822099
"--minimal",
20832100
...(input.ignoreWhitespace ? ["--ignore-all-space"] : []),
20842101
`${baseRef}...HEAD`,

0 commit comments

Comments
 (0)