Fix git bash prompt for detached head state
This commit is contained in:
parent
3793618a36
commit
5f1860089e
1 changed files with 3 additions and 3 deletions
6
bashrc
6
bashrc
|
@ -64,11 +64,11 @@ git__prompt () {
|
|||
if [ -z $branch ]
|
||||
then
|
||||
head=`git rev-parse --short HEAD 2>&1`
|
||||
if [ "$head" == ".*fatal.*" ]
|
||||
if [[ "$head" =~ fatal* ]]
|
||||
then
|
||||
branch='#'"$head"
|
||||
else
|
||||
branch='{no commits}'
|
||||
else
|
||||
branch='#'"$head"
|
||||
fi
|
||||
fi
|
||||
if [ "$branch" = 'master' ]
|
||||
|
|
Loading…
Reference in a new issue