summaryrefslogtreecommitdiff
path: root/01_Internal.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues.hiegel@qosmos.com>2012-06-19 17:09:12 +0200
committerHugues Hiegel <hugues.hiegel@qosmos.com>2012-06-19 17:09:12 +0200
commitef39caac87dd00f058030a5388b4fa857bdac620 (patch)
tree617310ec1aa9647abcc936bb1a89286517104959 /01_Internal.zsh
parent01bb4fe938cd6b1ed662653599cb50dd414f3574 (diff)
[Git] do not get stash list inside .git folders
Diffstat (limited to '01_Internal.zsh')
-rw-r--r--01_Internal.zsh15
1 files 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
}