# Extract git functions and add integration tests · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/f47dc3c78ca9496b80c4b4a2537c74bbd697fd9a)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: f47dc3c78ca9496b80c4b4a2537c74bbd697fd9a

Requested commit: f47dc3c78ca9496b80c4b4a2537c74bbd697fd9a

Commit: f47dc3c78ca9496b80c4b4a2537c74bbd697fd9a

Tree: 190d382f66e4eaa9fbe083b3d6d9e0c8fe203ecf

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
Extract git functions and add integration tests

Move git operations (listGitBranches, checkoutGitBranch, createGitWorktree,
etc.) from main.ts into git.ts for testability. Add 20 integration tests
that run real git commands against temporary repos covering checkout,
branch creation, worktrees, conflicts, and thread-switching flows.

Also fix: branch checkout now runs regardless of envMode, worktree
creation passes cwd to ensureSession to avoid stale closure bug, and
current branch auto-fills on new threads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

```

## Parents

- [e9cfe372bfaa35357b6c9402c5f1ff778fd72f3d](https://git.cafe/pingdotgg/t3code/commit/e9cfe372bfaa35357b6c9402c5f1ff778fd72f3d?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/f47dc3c78ca9496b80c4b4a2537c74bbd697fd9a?format=markdown)
