Add failing tests for HEAD propagation: source/target HEAD in Result + ProbeResult

Commit

Soph4mo ago

issue #45: git-sync mirrors refs but never propagates the source's HEAD symref target to the target. A repo mirrored from a default=main source into a default=master target ends up with a dangling target HEAD; a subsequent git clone target checks out master instead of main.

Step 1 of the implementation: pin the public contract via three failing integration tests that drive the API shape.

  • TestRun_IntegrationBootstrapSurfacesHEADInResult: source default master, target init'd with --default-branch=main, asserts Result exposes both HEAD targets as plumbing.ReferenceName.
  • TestRun_IntegrationBootstrapHEADMatch: same default on both sides, asserts SourceHEAD == TargetHEAD so callers can detect mismatch via field equality.
  • TestProbe_IntegrationSurfacesBothHEADs: probe surfaces the same info without mutating target, useful for previewing the mismatch.

The tests fail to build today (Result and ProbeResult don't have the SourceHEAD/TargetHEAD fields yet); subsequent commits add the fields and the capture logic.

Refs #45.

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

Checkpoints

does git-sync handle any ref or just branches

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1