make git_prompt_info aware of detached HEAD

this commit also checks for tag names once the repository has been
determined to be in a detached HEAD state