d8162cdded893abd83b31a8107ee604ecd45c719

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #1477 from madsgraphics/git_prompt_showstashstate

Add Stash toogle to display if there's some stash or not in `git_prompt_status`

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index 95dd3dd43313e655a7bc86ae6e3f9384f01faa84..b1dfce3575489d10d007ad3970d5b469f26cfad8 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -85,6 +85,9 @@ git_prompt_status() {
 6   elif $(echo "$INDEX" | grep '^AD ' &> /dev/null); then
 7     STATUS="$ZSH_THEME_GIT_PROMPT_DELETED$STATUS"
 8   fi
 9+  if $(git rev-parse --verify refs/stash >/dev/null 2>&1); then
10+    STATUS="$ZSH_THEME_GIT_PROMPT_STASHED$STATUS"
11+  fi
12   if $(echo "$INDEX" | grep '^UU ' &> /dev/null); then
13     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
14   fi
15@@ -102,7 +105,7 @@ git_prompt_status() {
16 
17 #compare the provided version of git to the version installed and on path
18 #prints 1 if input version <= installed version
19-#prints -1 otherwise 
20+#prints -1 otherwise
21 function git_compare_version() {
22   local INPUT_GIT_VERSION=$1;
23   local INSTALLED_GIT_VERSION