Commit 80322f0
fix(worktrees): always dirty-check before removal, even for non-utf8 paths
remove_worktree only ran the uncommitted/untracked-changes guard when
the worktree path was valid UTF-8 (via path().to_str()). For a non-utf8
path the check was silently skipped and the working directory was pruned
regardless of its contents — a data-loss window. RepoPath already
implements From<PathBuf>, so pass the path directly and drop the to_str
hop; behavior is identical for utf8 paths and the guard now always runs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 1f8b38c commit 80322f0
1 file changed
Lines changed: 6 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
| |||
0 commit comments