ref: implementation of FindRefName using the state file

For the match logic by `/`-separated segment provided by this
method, it would be quite unreasonable to *compute* the GitLab branches,
hence we bite the bullet and use the state file.

A comparison test makes sure the intended behaviour was well understood.
4 jobs for topic/default/find-ref-name-state-file in 1 minute and 14 seconds (queued for 1 second)
Status Job ID Name Coverage
  Main
passed #164814
tests-current

00:00:38

100.0%
 
  Compat
passed #164815
check-sdist

00:00:21

passed #164817
tests-hg-default

00:00:35

100.0%
passed #164816
tests-hg-stable

00:00:33

100.0%