>  Is that guaranteed?

Nope, it can also be `refs/heads/foobar` if it's a branch.