repository_head function

Get HEAD for a repository