From ef39caac87dd00f058030a5388b4fa857bdac620 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Tue, 19 Jun 2012 17:09:12 +0200 Subject: [Git] do not get stash list inside .git folders --- 01_Internal.zsh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/01_Internal.zsh b/01_Internal.zsh index a50fa6f..6ac5ec5 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -209,12 +209,15 @@ __get_git_branch () fi # Show number of stashed commits by appending '+' signs for each - local _stashed=$(git stash list | wc -l ) - [ "$_stashed" -gt 0 ] && my_git_branch+=$C_$_prompt_colors[bold_generic]$_C - [ "$_stashed" -gt 0 ] && for i in {1..$_stashed} - do - my_git_branch+="·" - done + if [ "$(git rev-parse --is-inside-git-dir)" != "true" -a "$(git config --get core.bare)" != "true" ] + then + local _stashed=$(git stash list | wc -l ) + [ "$_stashed" -gt 0 ] && my_git_branch+=$C_$_prompt_colors[bold_generic]$_C + [ "$_stashed" -gt 0 ] && for i in {1..$_stashed} + do + my_git_branch+="·" + done + fi echo $my_git_branch } -- cgit v1.2.3