File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,31 @@ find_git_branch() {
55 if [[ " $branch " == " HEAD" ]]; then
66 branch=' detached*'
77 fi
8- git_branch=" ($branch )"
8+ git_branch=" ($branch ) "
99 else
10- git_branch=" "
10+ git_branch=" "
1111 fi
1212}
1313
1414find_git_dirty () {
1515 local status=$( git status --porcelain 2> /dev/null)
1616 if [[ " $status " != " " ]]; then
17- git_dirty=' *'
17+ git_dirty=' * '
1818 else
1919 git_dirty=' '
2020 fi
2121}
2222
23- PROMPT_COMMAND=" find_git_branch; find_git_dirty; $PROMPT_COMMAND "
23+ find_git_stashes () {
24+ local stash=$( git stash list 2> /dev/null)
25+ if [[ " $stash " != " " ]]; then
26+ git_stash=' S '
27+ else
28+ git_stash=' '
29+ fi
30+ }
31+
32+ PROMPT_COMMAND=" find_git_branch; find_git_dirty; find_git_stashes; $PROMPT_COMMAND "
2433
2534# Default Git enabled prompt with dirty state
2635# export PS1="\u@\h \w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
You can’t perform that action at this time.
0 commit comments