# fix\(server\): a branch checked out in the terminal updates the branch label right away · pingdotgg/t3code

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

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

Visibility: public

Requested revision: 47c65ce325f8d83b48bb45813d007fde7748d432

Requested commit: 47c65ce325f8d83b48bb45813d007fde7748d432

Commit: 47c65ce325f8d83b48bb45813d007fde7748d432

Tree: 6ee6edaea49849587bc6bf95aaa16a1eee2291c6

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): a branch checked out in the terminal updates the branch label right away

A checkout made outside T3 Code, such as `git switch -c` in the integrated
terminal, calls no refresh RPC, and the background poll only reread local
status when ahead/behind counts moved. A new branch without an upstream
stayed labelled with the old branch until something else refreshed it.

Each status subscription now shares a per-checkout watch on the directory
holding its HEAD file (resolved with `git rev-parse --git-path HEAD`, so
linked worktrees work). A HEAD change rereads remote status without a fetch
and local status, and publishes them in one snapshot so the new branch is
never paired with the previous branch's PR or counts. The watch ends with
its last subscriber. The poll now rereads local status as a fallback.

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

```

## Parents

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

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