3c87d483628267e48fc0f462f46488dcd4f87810
- Author
- Andy Fowler <andy@andyfowler.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
makes git status prompt 4x faster
(via git status -s, benchmarked)
Diff
1diff --git a/lib/git.zsh b/lib/git.zsh
2index 629a08b0e10b370ebe923d00ea1e137374c080b8..1d1d24deb6dbb9dfbdf42f7230ec77eb56834968 100644
3--- a/lib/git.zsh
4+++ b/lib/git.zsh
5@@ -5,7 +5,7 @@ function git_prompt_info() {
6 }
7
8 parse_git_dirty () {
9- if [[ $((git status 2> /dev/null) | tail -n1) != "nothing to commit (working directory clean)" ]]; then
10+ if [[ -n $(git status -s 2> /dev/null) ]]; then
11 echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
12 else
13 echo "$ZSH_THEME_GIT_PROMPT_CLEAN"