Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/git/src/diff.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { exec, execLarge, execLines, execWithStdin } from './exec.js';

export function getDiff(args: string[] = []): string {
const cmd = ['git', 'diff', ...args].join(' ');
const cmd = ['git', 'diff', '--no-ext-diff', ...args].join(' ');
return execLarge(cmd);
}

Expand All @@ -14,7 +14,7 @@ export function getUntrackedDiff(files: string[]): string {

for (const file of files) {
try {
execLarge(`git diff --no-index -- /dev/null "${file}"`);
execLarge(`git diff --no-ext-diff --no-index -- /dev/null "${file}"`);
} catch (err: unknown) {
const error = err as { stdout?: string; status?: number };
if (error.status === 1 && error.stdout) {
Expand Down Expand Up @@ -58,7 +58,7 @@ export function resolveRef(ref: string, extraArgs: string[] = []): string {
export function getDiffFiles(ref: string): string[] {
const resolved = resolveDiffArgs(ref);

const tracked = execLines(`git diff --name-only ${resolved.args.join(' ')}`.trim());
const tracked = execLines(`git diff --no-ext-diff --name-only ${resolved.args.join(' ')}`.trim());
if (resolved.includeUntracked) {
const untracked = getUntrackedFiles();
return [...new Set([...tracked, ...untracked])];
Expand All @@ -67,7 +67,7 @@ export function getDiffFiles(ref: string): string[] {
}

export function getDiffStat(args: string[] = []): string {
const cmd = ['git', 'diff', '--stat', ...args].join(' ');
const cmd = ['git', 'diff', '--no-ext-diff', '--stat', ...args].join(' ');
try {
return execLarge(cmd);
} catch {
Expand Down