Files
DDL 48626f2df9 fix(merge): honor git worktree lock when cleaning up (#4073)
## Summary
- `wt merge` built a `RemovalPlan` by hand and skipped the lock check
`wt remove` already had, so a successful merge could rename a `git
worktree lock`'d feature worktree into trash and report success.
- After merge, a locked worktree is now kept (`Worktree preserved
(locked)`) the same way a primary worktree is kept. The shared staging
path also refuses a lock, including under `--force`, so every removal
caller is covered.

## Test plan
- [x] `cargo test --lib -- git::remove::tests` (includes
`stage_refuses_locked_worktree` and
`stage_refuses_locked_worktree_even_with_force`)
- [x] `cargo test --test integration
test_merge_preserves_locked_worktree`
- [x] `cargo test --test integration test_merge_fast_forward`
- [x] `cargo test --test integration test_remove_locked` (existing lock
tests still pass)
- [ ] `git worktree lock .` in a feature worktree, then `wt merge` —
merge succeeds, worktree stays, message names the lock reason


Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: worktrunk-bot <254187624+worktrunk-bot@users.noreply.github.com>
2026-09-12 19:25:46 -07:00
..