Commit a49a6ec
refactor(worktree): simplify deleteWorktree failure handling and unify parent-dir cleanup
/simplify pass:
- Replace the "prune-failed" string sentinel with null — both the
rename-couldn't-happen and prune-failed cases fall through to the same
in-place remove, so the sentinel was only there to be discarded.
- Remove the worktree's now-empty <base>/<name> parent directory in both
delete branches instead of only the trash-success path, so a deleted
worktree never leaves a stray parent behind regardless of which branch ran.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 52051ae commit a49a6ec
1 file changed
Lines changed: 17 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
578 | 580 | | |
579 | | - | |
580 | | - | |
| 581 | + | |
581 | 582 | | |
582 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
583 | 592 | | |
584 | 593 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
593 | 598 | | |
594 | 599 | | |
595 | 600 | | |
| |||
0 commit comments