added stash notification to git prompt
This commit is contained in:
@@ -14,6 +14,7 @@ function parse_git_branch {
|
|||||||
git rev-parse --git-dir > /dev/null 2>&1
|
git rev-parse --git-dir > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
git_status="$(git status 2> /dev/null)"
|
git_status="$(git status 2> /dev/null)"
|
||||||
|
git_stash="$(git stash list 2> /dev/null)"
|
||||||
branch_pattern="^# On branch ([^${IFS}]*)"
|
branch_pattern="^# On branch ([^${IFS}]*)"
|
||||||
detached_branch_pattern="# Not currently on any branch"
|
detached_branch_pattern="# Not currently on any branch"
|
||||||
remote_pattern="# Your branch is (.*) of"
|
remote_pattern="# Your branch is (.*) of"
|
||||||
@@ -26,6 +27,10 @@ function parse_git_branch {
|
|||||||
if [[ ${git_status}} =~ ${not_staged_pattern} ]]; then
|
if [[ ${git_status}} =~ ${not_staged_pattern} ]]; then
|
||||||
state="✔"
|
state="✔"
|
||||||
fi
|
fi
|
||||||
|
#files stashes
|
||||||
|
if [[ !${#git_stash} -eq 0 ]]; then
|
||||||
|
state="${state}☉"
|
||||||
|
fi
|
||||||
# add an else if or two here if you want to get more specific
|
# add an else if or two here if you want to get more specific
|
||||||
# show if we're ahead or behind HEAD
|
# show if we're ahead or behind HEAD
|
||||||
if [[ ${git_status} =~ ${remote_pattern} ]]; then
|
if [[ ${git_status} =~ ${remote_pattern} ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user