Add --no-optional-locks to prevent stale index.lock files (#63)

Prevents orphaned .git/index.lock files observed when running git status
from Claude Code's statusLine.
This commit is contained in:
Abildtoft
2026-01-12 00:39:03 +01:00
committed by GitHub
parent 1f365256e0
commit 4d7d41ff75

View File

@@ -43,7 +43,7 @@ export async function getGitStatus(cwd?: string): Promise<GitStatus | null> {
try {
const { stdout: statusOut } = await execFileAsync(
'git',
['status', '--porcelain'],
['status', '--porcelain', '--no-optional-locks'],
{ cwd, timeout: 1000, encoding: 'utf8' }
);
isDirty = statusOut.trim().length > 0;