Fall back when source doesn't advertise HEAD

main

Commit

nodo4mo ago

Some HTTP v1 servers don't return HEAD in their info/refs. Previously HEAD was left at PlainInit's default refs/heads/master, which then fails the --check HEAD step on any main-default repo. pickHEAD now selects in order: server-advertised HEAD (resolved via the matched DesiredRef.TargetRef so user-supplied ref mappings are honored), refs/heads/main, refs/heads/master, then the lexicographically first branch. Tags-only conversions still leave HEAD at the PlainInit default since there's no sensible branch to point at.

Entire-Checkpoint: 161329c78d89

Checkpoints

let's address some review comment for this change

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1