Current ref name lookup.

Get head name for any ref (local/remote branch or tag).

Uses sha compare to get right name.

Developed for https://github.com/AndrewRomanenco/git.ios