Only show the branch specifier if the current directory is part of a git repo

I couldn't come up with an alternate method of doing this. It works for empty directories (since you can't have a truly empty directory in git). 
I personally use this because my home folder is a git repo.