Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

fix: resolve branch name from worktree when target is a path#43

Merged
davidpoblador merged 1 commit intomainfrom
fix/wt-rm-branch-from-path
Feb 10, 2026
Merged

fix: resolve branch name from worktree when target is a path#43
davidpoblador merged 1 commit intomainfrom
fix/wt-rm-branch-from-path

Conversation

@davidpoblador
Copy link
Member

Summary

  • When wt-rm or wt-destroy receive an absolute path (e.g., /Users/foo/repos/project/fix/branch), branch operations (git branch -d, git push origin --delete) used the full path instead of the actual branch name
  • Now resolves the branch name from git worktree list --porcelain before removing the worktree, falling back to the raw target when no match is found

Test plan

  • Run just wt-add test/foo then just wt-rm <absolute-path-to-test/foo> and verify the branch name in output is test/foo, not the absolute path
  • Run just wt-add bar then just wt-rm bar and verify it still works with plain branch names
  • Verify wt-destroy behaves the same way with both path and branch name inputs

🤖 Generated with Claude Code

When wt-rm or wt-destroy receive an absolute path, the branch name
passed to git branch -d/-D was the full path instead of the actual
branch name. Now resolves the branch from git worktree list --porcelain
before removal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davidpoblador davidpoblador merged commit b0ff7de into main Feb 10, 2026
1 check passed
@davidpoblador davidpoblador deleted the fix/wt-rm-branch-from-path branch February 10, 2026 07:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant