Add - and _ to possible branch names in prompt

This commit is contained in:
Talia 2018-12-09 13:52:47 +01:00
parent 5f1860089e
commit 56b53ce265

2
bashrc
View file

@ -31,7 +31,7 @@ git__prompt () {
if [ $? = 0 ] if [ $? = 0 ]
then then
status=`git status --short 2>/dev/null` status=`git status --short 2>/dev/null`
branch=`git branch | grep -Po '(?<=\* )[[:alnum:]]*'` branch=`git branch | grep -Po '(?<=\* )[[:alnum:]_-]*'`
modif=`echo "$status" | grep -Po '^\s*M' | wc -l` modif=`echo "$status" | grep -Po '^\s*M' | wc -l`
untracked=`echo "$status" | grep -Po '^\?\?' | wc -l` untracked=`echo "$status" | grep -Po '^\?\?' | wc -l`
added=`echo "$status" | grep -Po '^\s*[A]' | wc -l` added=`echo "$status" | grep -Po '^\s*[A]' | wc -l`