# fix\(server\): bulk worktree launches no longer fail on Git races · pingdotgg/t3code

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

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

Visibility: public

Requested revision: b9c904d1a099bc6fe213fc6b3e18c9a3a0d77083

Requested commit: b9c904d1a099bc6fe213fc6b3e18c9a3a0d77083

Commit: b9c904d1a099bc6fe213fc6b3e18c9a3a0d77083

Tree: aa1760199a4f510aa7d661fd20e9fd1c665aef3e

Author: Jake Leventhal

Committer: Jake Leventhal

## Message

```
fix(server): bulk worktree launches no longer fail on Git races

Launching many threads into new worktrees at once failed most of them:
concurrent fetches of the base lost the ref lock, branch and path names
collided, and concurrent writes to the shared Git config failed on its
lock. Retry hit the same collisions again.

Concurrent fetches of one ref now share a single running fetch. A taken
branch or path gets the next `-1`, `-2` suffix, the same style renames
use, while Git stays the arbiter. Config writes and branch renames take a
per-repository lock, so checkouts stay concurrent and concurrent renames
pick distinct names.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

```

## Parents

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

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