get_backup_branch_name() lists branches through list_heads() since
49e205ac. The legacy core passes GitPython's git.Repo, which has no
such method; the error was swallowed and the name was returned without
a collision check, so creating the backup branch failed when one of
the same second existed.
- Read the branches from heads when the repository has no list_heads()
- Repair the tests: the fake repository still exposed heads, so the
collision cases exercised the error fallback and failed
- Run the behaviour tests against both copies of the function, add a
real-repository test as each core opens it, and freeze the clock