Skip to content

fix: display full branch path for worktrees with slashes#139

Merged
avihut merged 1 commit intomasterfrom
daft-134/fetch-full-path
Feb 1, 2026
Merged

fix: display full branch path for worktrees with slashes#139
avihut merged 1 commit intomasterfrom
daft-134/fetch-full-path

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Feb 1, 2026

Summary

  • Fix worktree display names in fetch and carry commands to show the full relative path (e.g., feature/test-feature) instead of just the last component (test-feature) when branch names contain slashes
  • Reorder resolve_worktree_path matching to prefer relative-path matching first (most precise) over file_name() matching (convenience shorthand), preventing ambiguous matches

Test plan

  • cargo fmt -- passes
  • cargo clippy -- -D warnings -- passes
  • just test-unit -- 140 tests pass
  • just test-integration-fetch -- 15 tests pass, including fetch_multiple_worktrees which uses feature/test-feature

Fixes #134

🤖 Generated with Claude Code

Use strip_prefix instead of file_name to extract worktree display names
in fetch and carry commands, so branch names with slashes like
feature/test-feature show correctly instead of just the last component.

Reorder resolve_worktree_path matching to prefer relative-path matching
first (most precise) over file_name matching (convenience shorthand),
preventing ambiguous matches when branches share a last path component.

Fixes #134

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@avihut avihut self-assigned this Feb 1, 2026
@avihut avihut added this to the v1.1.0 milestone Feb 1, 2026
@avihut avihut added bug Something isn't working fix Bug fix labels Feb 1, 2026
@avihut avihut merged commit 66b42b9 into master Feb 1, 2026
5 checks passed
@avihut avihut deleted the daft-134/fetch-full-path branch February 1, 2026 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gwtfetch doesn't detect branch name properly with slashes

1 participant