Better git branch detection, suppress errors

Previously, my git prompt would get very unhappy when placed into a freshly
git-init'd directory. Now it displays something sensible