feat(editor): Changes view mode — in-tab HEAD-vs-working-tree diff (#1353)

Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
Brennan Benson
2026-05-03 16:17:07 -07:00
committed by GitHub
co-authored by Orca
parent 7edcdca699
commit eaebd08ff9
20 changed files with 639 additions and 118 deletions
+5 -2
View File
@@ -290,7 +290,8 @@ export async function resolveGitDir(worktreePath: string): Promise<string> {
export async function getDiff(
worktreePath: string,
filePath: string,
staged: boolean
staged: boolean,
compareAgainstHead = false
): Promise<GitDiffResult> {
let originalContent = ''
let modifiedContent = ''
@@ -300,7 +301,9 @@ export async function getDiff(
try {
const leftBlob = staged
? await readGitBlobAtOidPath(worktreePath, 'HEAD', filePath)
: await readUnstagedLeftBlob(worktreePath, filePath)
: compareAgainstHead
? await readGitBlobAtOidPath(worktreePath, 'HEAD', filePath)
: await readUnstagedLeftBlob(worktreePath, filePath)
originalContent = leftBlob.content
originalIsBinary = leftBlob.isBinary