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 ]
|
if [ -z $branch ]
|
||||||
then
|
then
|
||||||
head=`git rev-parse --short HEAD 2>&1`
|
head=`git rev-parse --short HEAD 2>&1`
|
||||||
if [ "$head" == ".*fatal.*" ]
|
if [[ "$head" =~ fatal* ]]
|
||||||
then
|
then
|
||||||
branch='#'"$head"
|
|
||||||
else
|
|
||||||
branch='{no commits}'
|
branch='{no commits}'
|
||||||
|
else
|
||||||
|
branch='#'"$head"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$branch" = 'master' ]
|
if [ "$branch" = 'master' ]
|
||||||
|
|
Loading…
Reference in a new issue