I didn't realize it would print HEAD if there was no branch. Let's not redefine this in ways that would surprise or annoy git users :-) My bad.