Doctests for git.

- Only raise that error if the repo is not HEAD.