diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 1683e6d..86e39a5 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -117,6 +117,7 @@ __git_ps1 () local w local i + local s local c if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then @@ -136,15 +137,19 @@ __git_ps1 () else i="#" fi + stash_list=`git stash list` + if [ -n "$stash_list" ]; then + s="$" + fi fi fi fi if [ -n "$b" ]; then if [ -n "${1-}" ]; then - printf "$1" "$c${b##refs/heads/}$w$i$r" + printf "$1" "$c${b##refs/heads/}$w$i$s$r" else - printf " (%s)" "$c${b##refs/heads/}$w$i$r" + printf " (%s)" "$c${b##refs/heads/}$w$i$s$r" fi fi fi