Surface source HEAD symref in Result and ProbeResult

Commit

Soph4mo ago

The source's symref HEAD target (e.g. refs/heads/main) is already captured during the source advertisement parse but never escapes the session. Surface it on syncer.Result and syncer.ProbeResult so library callers and the CLI can compare against the target's intended default branch.

The test-server scope grew slightly: the v2 ls-refs handler now honors the symrefs argument and emits HEAD with a symref-target attribute, mirroring what real git advertises. Two new integration tests pin the field through both Sync and Probe.

Target HEAD is deliberately not exposed here. The receive-pack advertisement we already perform doesn't include HEAD (per go-git's serve.go: addReferences passes addHead=false for forPush), and detecting it would need a separate upload-pack round-trip against the target. Tracked as a follow-up.

Refs #45.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com Entire-Checkpoint: 5e441c7c5d73

Checkpoints

does git-sync handle any ref or just branches

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1