fix: avoid repeated macOS privacy prompts (#1524)
* fix: avoid repeated macos privacy prompts * fix: reduce background worktree permission probes * chore: pin oxlint for ci * fix: preserve optional rpc params with zod 4.4 * fix: preserve optional inline rpc params with zod 4.4
This commit is contained in:
@@ -72,15 +72,30 @@ export function parseConflictKind(xy: string): string | null {
|
||||
export function parseStatusOutput(stdout: string): {
|
||||
entries: Record<string, unknown>[]
|
||||
unmergedLines: string[]
|
||||
head?: string
|
||||
branch?: string
|
||||
} {
|
||||
const entries: Record<string, unknown>[] = []
|
||||
const unmergedLines: string[] = []
|
||||
let head: string | undefined
|
||||
let branch: string | undefined
|
||||
|
||||
for (const line of stdout.split(/\r?\n/)) {
|
||||
if (!line) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (line.startsWith('# branch.oid ')) {
|
||||
head = line.slice('# branch.oid '.length).trim()
|
||||
continue
|
||||
}
|
||||
|
||||
if (line.startsWith('# branch.head ')) {
|
||||
const branchHead = line.slice('# branch.head '.length).trim()
|
||||
branch = branchHead && branchHead !== '(detached)' ? `refs/heads/${branchHead}` : ''
|
||||
continue
|
||||
}
|
||||
|
||||
if (line.startsWith('1 ') || line.startsWith('2 ')) {
|
||||
const parts = line.split(' ')
|
||||
const xy = parts[1]
|
||||
@@ -130,7 +145,7 @@ export function parseStatusOutput(stdout: string): {
|
||||
}
|
||||
}
|
||||
|
||||
return { entries, unmergedLines }
|
||||
return { entries, unmergedLines, head, branch }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user