Simplify after review: dedupe hoist helpers, inline trivial wrapper

main

Commit

Soph4mo ago
  • Extract hoistFirstMatch[T] generic and use it for both the new hoistSourceHeadCommand (PushCommand slice) and the existing orderTrunkFirst (DesiredRef slice). Same move-to-front-by-name algorithm in both; one implementation now.
  • Drop syncSession.sourceHead() wrapper. The nil guard was dead code: every caller already dereferences s.sourceService directly nearby (.Protocol, .Capabilities() in the same Result builders). Inline as s.sourceService.HeadTarget at the six construction sites.
  • Use syncertest.SetRefAtBranch instead of raw SetReference in the bootstrap-ordering integration test, matching the existing helper's use elsewhere in this file.
  • Trim Result struct docstring trailer — the field's own line is enough.

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

Checkpoints

does git-sync handle any ref or just branches

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1