Add --color=always to git diff commands
This commit is contained in:
parent
b4b5a11a90
commit
a640d15a2c
|
|
@ -335,15 +335,15 @@ program
|
|||
|
||||
if (status.text().trim().length > 0) {
|
||||
// Show uncommitted changes (both staged and unstaged)
|
||||
const result = await $`git -C ${session.worktree} diff HEAD`.nothrow()
|
||||
const result = await $`git -C ${session.worktree} diff --color=always HEAD`.nothrow()
|
||||
if (result.exitCode !== 0) {
|
||||
// HEAD may not exist yet (no commits); fall back to showing all tracked + untracked
|
||||
await $`git -C ${session.worktree} diff`.nothrow()
|
||||
await $`git -C ${session.worktree} diff --color=always`.nothrow()
|
||||
}
|
||||
} else {
|
||||
// No uncommitted changes — show full branch diff vs main
|
||||
const main = await git.mainBranch(root)
|
||||
const result = await $`git -C ${session.worktree} diff ${main}...${branch}`.nothrow()
|
||||
const result = await $`git -C ${session.worktree} diff --color=always ${main}...${branch}`.nothrow()
|
||||
if (result.exitCode !== 0) {
|
||||
console.error("git diff failed")
|
||||
process.exit(1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user