8ce35df2c5aa333dd394f6e7e2700538c10d9a90

Author
Martin Meredith <martinmeredith@protecinnovations.co.uk>
Committer
Martin Meredith <martinmeredith@protecinnovations.co.uk>
Date

Message

Add option to disable status notification

For certain git repositories, this slows down usage
of the shell horifically.

This option can be set with

    git config --add oh-my-zsh.hide-status 1

which will disable checking/showing the status notification

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index fb4ad8ca64ffbf7bcfd34ca82b1acbe8947d36bf..6c878afff42756a53910ff31a667ffa6302bb797 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -8,13 +8,15 @@ function git_prompt_info() {
 6 # Checks if working tree is dirty
 7 parse_git_dirty() {
 8   local SUBMODULE_SYNTAX=''
 9-  if [[ $POST_1_7_2_GIT -gt 0 ]]; then
10-        SUBMODULE_SYNTAX="--ignore-submodules=dirty"
11-  fi
12-  if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
13-    echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
14-  else
15-    echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
16+  if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then
17+    if [[ $POST_1_7_2_GIT -gt 0 ]]; then
18+          SUBMODULE_SYNTAX="--ignore-submodules=dirty"
19+    fi
20+    if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
21+      echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
22+    else
23+      echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
24+    fi
25   fi
26 }
27