Add a check for HEAD

so it doesn't barf on first commit