From 2cd1323e0ab180011316ff93c3503c33b996f649 Mon Sep 17 00:00:00 2001 From: Minh Tran Date: Tue, 27 Sep 2011 11:26:51 +0200 Subject: [PATCH] Added a function to provide Git stash info to the prompt --- lib/git.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index f04343650..c5310b0c0 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -30,6 +30,13 @@ function git_prompt_long_sha() { SHA=$(git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } +# Checks if there are stashed changes +function git_prompt_stash() { + if [[ -n $(git stash list 2> /dev/null) ]]; then + echo "$ZSH_THEME_GIT_PROMPT_STASH" + fi +} + # Get the status of the working tree git_prompt_status() { INDEX=$(git status --porcelain 2> /dev/null)