Refactor head method to use git2r_repository_head