Skip to content

fix: gitprune breaks when a branch is checked out in another worktree - #15

Merged
1shooperman merged 1 commit into
mainfrom
fix/broken-gitrefresh
Sep 24, 2026
Merged

1shooperman merged 1 commit into
mainfrom
fix/broken-gitrefresh

Conversation

@1shooperman

Copy link
Copy Markdown
Owner

Summary

  • git branch -vv prefixes the line for a branch checked out in a linked worktree with + (and current branch with *)
  • awk '{print $1}' in gitprune/gitrefresh grabbed that marker instead of the branch name, producing xargs git branch -D + → error: branch '+' not found
  • Fixed both -D and -d code paths to pick field 2 when field 1 is * or +

Test plan

  • Run gitrefresh in a repo with an active linked worktree and confirm no error: branch '+' not found
  • Confirm normal branch pruning still deletes stale branches as expected

🤖 Generated with Claude Code

git branch -vv prefixes a branch checked out in a linked worktree with
'+' (current branch gets '*'); awk '{print $1}' grabbed that marker
instead of the branch name, so xargs passed 'git branch -D +' and
failed with "error: branch '+' not found".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@1shooperman
1shooperman merged commit a232a3e into main Sep 24, 2026
2 checks passed
@1shooperman
1shooperman deleted the fix/broken-gitrefresh branch September 24, 2026 11:35
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.

1 participant