holman / dotfiles

@holman does dotfiles
http://zachholman.com/2010/08/dotfiles-are-meant-to-be-forked/
MIT License
7.35k stars 3.36k forks source link

Git don't throw up when not on some branch #302

Open spruce opened 6 years ago

spruce commented 6 years ago

Hi, thanks for the best dotfiles yet πŸ‘ . Now to my "problem". Currently when being in a detached HEAD state the prompt throws up and always shows a warning that

fatal: ref HEAD is not a symbolic ref

and shows an incomplete prompt e.g.:

πŸ”Œ  ⚑️in .dotfiles/ on

This PR fixes that and displays:

πŸ”Œ  ⚑️  in .dotfiles/ on detached HEAD

Maybe the message could be tweak a little (maybe show commit sha) but is in my opinion way better than throwing an error.