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:
@@ -49,11 +49,18 @@ export async function getStatusOp(
|
||||
git: GitExec,
|
||||
validatePath: (p: string) => void,
|
||||
params: Record<string, unknown>
|
||||
): Promise<{ entries: Record<string, unknown>[]; conflictOperation: string }> {
|
||||
): Promise<{
|
||||
entries: Record<string, unknown>[]
|
||||
conflictOperation: string
|
||||
head?: string
|
||||
branch?: string
|
||||
}> {
|
||||
const worktreePath = params.worktreePath as string
|
||||
validatePath(worktreePath)
|
||||
const conflictOperation = await detectConflictOperation(worktreePath)
|
||||
const entries: Record<string, unknown>[] = []
|
||||
let head: string | undefined
|
||||
let branch: string | undefined
|
||||
|
||||
try {
|
||||
// Why: -c core.quotePath=false keeps non-ASCII filenames as raw UTF-8 in
|
||||
@@ -61,11 +68,20 @@ export async function getStatusOp(
|
||||
// entry.path renders as gibberish in the source-control sidebar and
|
||||
// downstream blob lookups miss.
|
||||
const { stdout } = await git(
|
||||
['-c', 'core.quotePath=false', 'status', '--porcelain=v2', '--untracked-files=all'],
|
||||
[
|
||||
'-c',
|
||||
'core.quotePath=false',
|
||||
'status',
|
||||
'--porcelain=v2',
|
||||
'--branch',
|
||||
'--untracked-files=all'
|
||||
],
|
||||
worktreePath
|
||||
)
|
||||
const parsed = parseStatusOutput(stdout)
|
||||
entries.push(...parsed.entries)
|
||||
head = parsed.head
|
||||
branch = parsed.branch
|
||||
|
||||
for (const uLine of parsed.unmergedLines) {
|
||||
const entry = parseUnmergedEntry(worktreePath, uLine)
|
||||
@@ -77,5 +93,5 @@ export async function getStatusOp(
|
||||
// not a git repo or git not available
|
||||
}
|
||||
|
||||
return { entries, conflictOperation }
|
||||
return { entries, conflictOperation, head, branch }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user