Skip to content

Fix background force-delete for flag-like branches - #4253

Merged
max-sixty merged 1 commit into
max-sixty:mainfrom
Duang777:fix/background-force-delete-flag-like-branch
Sep 24, 2026
Merged

max-sixty merged 1 commit into
max-sixty:mainfrom
Duang777:fix/background-force-delete-flag-like-branch

Conversation

@Duang777

Copy link
Copy Markdown
Contributor

Summary

  • Pass the branch name after -- in the detached background force-delete fallback.
  • Add an end-to-end regression test for a plumbing-created -x branch when the staged rename fails.

Root cause

The rename-failure fallback generated git branch -D <branch>. Git interpreted a valid flag-like ref as an option, so the worktree disappeared but the branch remained.

Tests

  • Confirmed the new regression test timed out on the old command while waiting for refs/heads/-x to be deleted.
  • Confirmed the regression test and all four background fallback integration tests pass after the fix.
  • cargo test test_build_remove_command
  • cargo run -- hook pre-merge --yes (4964 passed, 1 skipped)

@max-sixty
max-sixty merged commit 96a00ef into max-sixty:main Sep 24, 2026
38 checks passed
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.

3 participants