Files
Maximilian RoosandClaude Opus 5.5 ab2a1e3a2e fix(remove): warn when a submodule holds commits on no remote (#4460)
Removing a worktree deletes its submodules' module stores, and with them
any commit no remote-tracking ref reaches, including reflog-only ones.
Removal now warns before proceeding:

```
▲ Submodule submod has commits on no remote; removing the worktree deletes them
```

It still removes, so shallow or SHA-fetched pins (which can look the
same) never need `--force`. `--force` skips the check, having already
consented to losing what the worktree holds. The picker removes
silently, as it does for everything else.

This replaces the earlier refuse-unless-`--force` version of this PR,
per the decision to warn instead. The test-only commit routing
`GIT_EXEC_PATH` to Git's real exec path is kept, since `git submodule`
needs Git's helpers when wt runs as `git wt`.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 15:53:48 -07:00
..