If WorktreeAddAsync succeeds but the worktrees-row insert throws, the worktree was left on disk and branch undeleted with nothing tracking it. Wrap the insert in try/catch and best-effort remove the worktree+branch (non-cancellable) before rethrowing. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
9.5 KiB
9.5 KiB