Update files
This commit is contained in:
@@ -547,8 +547,14 @@ export async function getCheckoutDiff(
|
|||||||
throw new Error(`Base ref mismatch: expected ${baseRef}, got ${compare.baseRef}`);
|
throw new Error(`Base ref mismatch: expected ${baseRef}, got ${compare.baseRef}`);
|
||||||
} else {
|
} else {
|
||||||
const normalizedBaseRef = normalizeLocalBranchRefName(baseRef);
|
const normalizedBaseRef = normalizeLocalBranchRefName(baseRef);
|
||||||
// Diff base ref against working tree (includes uncommitted changes)
|
// Find the merge-base (common ancestor) to diff only changes on this branch
|
||||||
const { stdout: trackedDiff } = await execAsync(`git diff ${normalizedBaseRef}`, {
|
const { stdout: mergeBaseOut } = await execAsync(
|
||||||
|
`git merge-base ${normalizedBaseRef} HEAD`,
|
||||||
|
{ cwd, env: READ_ONLY_GIT_ENV }
|
||||||
|
);
|
||||||
|
const mergeBase = mergeBaseOut.trim();
|
||||||
|
// Diff from merge-base to working tree (includes uncommitted changes)
|
||||||
|
const { stdout: trackedDiff } = await execAsync(`git diff ${mergeBase}`, {
|
||||||
cwd,
|
cwd,
|
||||||
env: READ_ONLY_GIT_ENV,
|
env: READ_ONLY_GIT_ENV,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user