feat(FN-4508): complete Step 2 — handle tip-already-merged recovery paths
Fusion-Task-Id: FN-4508 Fusion-Task-Lineage: 948a9cae-3975-4f15-bd47-2f88b379171d
This commit is contained in:
@@ -267,8 +267,15 @@ export class WorktreePool {
|
||||
ownerTaskId: taskId,
|
||||
startPoint: base,
|
||||
});
|
||||
if (inspection.kind === "stale" || inspection.kind === "stale-resolved") {
|
||||
if (inspection.kind === "stale" || inspection.kind === "stale-resolved" || inspection.kind === "tip-already-merged") {
|
||||
await execAsync("git worktree prune", { cwd: worktreePath });
|
||||
if (inspection.kind === "tip-already-merged") {
|
||||
try {
|
||||
await execAsync(`git branch -D "${branchName}"`, { cwd: worktreePath });
|
||||
} catch {
|
||||
// best-effort
|
||||
}
|
||||
}
|
||||
await execAsync(checkoutCmd, { cwd: worktreePath });
|
||||
await assertCleanBranchAtBase(worktreePath, branchName, resolvedBase, taskId);
|
||||
return { branch: branchName, worktreePath, reclaimed: false };
|
||||
|
||||
Reference in New Issue
Block a user