Add a function to resolve a RefSpecTy to a Ref
readRefFile starts to resolve a reference but gives us just the low-level state. If it is a RefLink we need to loop on readRefFile (I suppose the reference might be circular also) to actually get down to the base Ref.
This is annoying.
Also, it doesn't work on a Git, it takes a FilePath to the repo.