This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Commit aba7142
fix: clean up empty parent directories after worktree removal (#41)
When using nested branch names like `fix/issue-x`, removing the worktree
leaves empty parent directories behind. Add a loop to both wt-rm and
wt-destroy that walks up from the target's parent, removing empty
directories until it hits the project root or a non-empty directory.
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent e1fc3c4 commit aba7142
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
61 | 68 | | |
62 | 69 | | |
63 | 70 | | |
| |||
79 | 86 | | |
80 | 87 | | |
81 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
82 | 96 | | |
83 | 97 | | |
84 | 98 | | |
| |||
0 commit comments