Skip to content

feat: cd to existing worktree instead of failing#51

Merged
avihut merged 1 commit intodevelopfrom
daft-40/gcw-to-existing-just-cd
Jan 17, 2026
Merged

feat: cd to existing worktree instead of failing#51
avihut merged 1 commit intodevelopfrom
daft-40/gcw-to-existing-just-cd

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Jan 17, 2026

Summary

  • Updated git-worktree-checkout to detect when the requested branch already has a worktree
  • Instead of failing with an error, the command now cds to the existing worktree
  • Added shell integration marker output for proper shell wrapper support

Test plan

  • Unit tests pass (cargo test)
  • Clippy passes (cargo clippy -- -D warnings)
  • Format check passes (cargo fmt -- --check)
  • Integration tests pass (just test-integration-checkout - 21 tests)
  • New dedicated test test_checkout_existing_worktree verifies the behavior

Fixes #40

🤖 Generated with Claude Code

@avihut avihut self-assigned this Jan 17, 2026
@avihut avihut added the enhancement New feature or request label Jan 17, 2026
@avihut avihut added this to the v1.0.0 milestone Jan 17, 2026
@avihut avihut linked an issue Jan 17, 2026 that may be closed by this pull request
@avihut avihut merged commit 497dc51 into develop Jan 17, 2026
3 checks passed
@avihut avihut deleted the daft-40/gcw-to-existing-just-cd branch January 17, 2026 21:24
avihut added a commit that referenced this pull request Jan 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

worktree-checkout to existing worktree just cds to that worktree

1 participant