Simplify remote-helper transport after review
main·
Commit

Post-review cleanup of the remote-helper transport, no behavior change:
- Extract a shared readRawPktLine primitive in pktline.go and route both readAdvertisement and responseEndReader through it, replacing two hand-rolled copies of pkt-line header parsing. This also adds the pktline.MaxSize bound both copies were missing, and lets responseEndReader reuse one grow-only buffer instead of allocating per packet — relaying a multi-GB pack now costs no per-packet allocation.
- Drop the unreachable os.ErrClosed guard in helperProcess.finish (the sync.Once already makes a redundant close impossible) and collapse it to a single errors.Join.
- Merge RequestInfoRefs's twin error branches into one errors.Join.
- Fold newConn's scheme dispatch into a single switch so the native scheme set is named once instead of split between a switch and a trailing if.
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com Entire-Checkpoint: de61fb4754bb
Checkpoints
❯ GITSYNC_MAX_REF_UPDATES_PER_PUSH=5000 go run ./cmd/git-sync replicate --all-refs --stats --verbose \
Claude CodeOpus 4.8[1m]
View sessionCheckpoint 1