refactor(workspaces): drop the unused locked worktree flag

Nothing consumed GitWorktreeInfo.locked: a locked worktree is a real checkout
and stays a usable workspace, so no caller needs to distinguish it. Unknown
porcelain keys are already ignored, so parsing it was speculative.

The parser test still feeds a real `locked` line and asserts it is ignored, and
the service test still pins that a present, non-prunable worktree is kept, so
the policy stays covered without the field.
This commit is contained in:
Federico Jaramillo Martinez
2026-07-26 22:25:59 +02:00
parent d7fc25312d
commit 9848fc3e40
3 changed files with 7 additions and 8 deletions
@@ -11,8 +11,6 @@ export interface GitWorktreeInfo {
detached?: boolean;
/** Git reports a linked worktree as prunable when its checkout directory no longer exists. */
prunable?: boolean;
/** Git reports a locked worktree with a bare `locked` line, optionally followed by a reason. */
locked?: boolean;
}
export async function isGitRepository(path: string): Promise<boolean> {
@@ -46,7 +44,6 @@ export function parseGitWorktreeList(stdout: string): GitWorktreeInfo[] {
if (key === "bare") info.bare = true;
if (key === "detached") info.detached = true;
if (key === "prunable") info.prunable = true;
if (key === "locked") info.locked = true;
}
return info;
}).filter((w) => w.path);