Repository navigation
fix(worktrees): preserve recoverable work during removal and retries - #6823
joeyfrasier wants to merge 1 commit into
Conversation
Agent: OpenAI Codex
|
Thanks for the pull request, @joeyfrasier. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request. Linked issue. Every pull request must close an open issue in this repository. The issue keeps the problem tracked even if this pull request closes or we take a different approach. Open an issue for the change, or find an existing one, and add See CONTRIBUTING.md for details. |
Human comments
What was wrong
Keep unfinished Git work recoverable when a managed worktree retires. The remover used forced Git removal and a recursive-deletion fallback, so clean-looking or uninspectable worktrees could lose files or private refs. Provisioning retries could also remove an old worktree and reset the branch retaining its commits.
What changed
Removal now checks tracked, untracked, ignored, hidden-index, private-ref, in-progress-operation, and retained-commit state before stopping processes and again under mutation locks. Git removal runs without force, has no recursive fallback, and preserves recovery markers on failure. Retries refuse branch resets with commits outside the selected base. Updated the worktree and CLI guides. No wire fields changed.
How you verified
Refs #5952. This adds removal protection; archive-dialog warnings and atomic protection against unrelated external writers remain separate work.
Fixes #6824