Add support for identifying a git detached head

When working with remotes, it is nice to be able to detect/display when you are in a detached head.  This change should address that &mdash; which also has the added benefit of reducing the git commands on non-headless branches by 1.