# Handle branch selection across main and secondary worktrees · screen/t3code-personal

[View on GitCafe](https://git.cafe/screen/t3code-personal/commit/9bb9023009b0c45c66a609c386cd233855043caf)

Repository: [screen/t3code-personal](https://git.cafe/screen/t3code-personal)

Visibility: public

Requested revision: 9bb9023009b0c45c66a609c386cd233855043caf

Requested commit: 9bb9023009b0c45c66a609c386cd233855043caf

Commit: 9bb9023009b0c45c66a609c386cd233855043caf

Tree: 376bff1c6a8a5d9882012fbb79ae35c6207122bc

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
Handle branch selection across main and secondary worktrees

- add `resolveBranchSelectionTarget` to unify checkout cwd/worktree decisions
- reuse existing worktrees when available, including switching back to main repo
- update branch selector to use shared logic and add targeted unit tests

```

## Parents

- [f70cb5de4517e55f62ed2c71e49291d97a7dc927](https://git.cafe/screen/t3code-personal/commit/f70cb5de4517e55f62ed2c71e49291d97a7dc927?format=markdown)

[Source at this commit](https://git.cafe/screen/t3code-personal/tree/9bb9023009b0c45c66a609c386cd233855043caf?format=markdown)
