Skip to content

fix(worktree): recover empty cleanup shells - #650

Open
dawNotPoi wants to merge 1 commit into
xintaofei:mainfrom
dawNotPoi:fix/642-clean-worktree-cleanup
Open

fix(worktree): recover empty cleanup shells#650
dawNotPoi wants to merge 1 commit into
xintaofei:mainfrom
dawNotPoi:fix/642-clean-worktree-cleanup

Conversation

@dawNotPoi

Copy link
Copy Markdown
Contributor

Summary

  • recover cleanup when Git has already detached a worktree but left an empty directory shell behind
  • remove only a proven-empty shell before pruning stale registration and deleting the task branch
  • preserve fail-closed behavior for non-empty or unreadable paths while leaving normal worktree removal unchanged

Testing

  • cargo test --no-default-features --features test-utils --lib worktree_ -- --nocapture (41 passed)
  • cargo check --no-default-features --features test-utils --lib
  • cargo clippy --no-default-features --features test-utils --lib --tests -- -D warnings
  • git diff --check

Repository-wide cargo fmt --check still reports pre-existing formatting differences outside this change; the modified hunks were checked separately.

Closes #642

@dawNotPoi
dawNotPoi marked this pull request as ready for review September 4, 2026 07:18
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.

Clean zero-change task cleanup partially removes worktree, then falsely reports uncommitted files

1 participant