Skip to content

fix(worktree): refuse dirty terminal finalization#943

Merged
chubes4 merged 2 commits into
mainfrom
fix/935-clean-finalization
Jul 21, 2026
Merged

fix(worktree): refuse dirty terminal finalization#943
chubes4 merged 2 commits into
mainfrom
fix/935-clean-finalization

Conversation

@chubes4

@chubes4 chubes4 commented Jul 21, 2026

Copy link
Copy Markdown
Member

Closes #935

Summary

  • reject terminal and cleanup-signalling lifecycle updates when porcelain status is dirty
  • report bounded staged, unstaged, and untracked path evidence with remediation
  • preserve active lifecycle updates and avoid mutating metadata on failed finalization
  • reuse the cleanup git-status probe contract

How to test

  1. Run php tests/worktree-add-lifecycle.php.
  2. Run git diff --check origin/main...HEAD.

Compatibility

Only terminal or cleanup-signalling lifecycle transitions change behavior. Dirty active worktrees remain valid; callers must commit, stash, or discard changes before marking a worktree terminal.

@chubes4
chubes4 merged commit 397798c into main Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refuse dirty terminal worktree finalization

1 participant