diff options
author | Robby Russell <robby@planetargon.com> | 2013-12-02 22:28:11 -0800 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-12-02 22:28:11 -0800 |
commit | ac838345f5cd0f440bd75dfc98c98b9691b03164 (patch) | |
tree | e71ab02439a37bb3b0c2d7f26c07db45c5d29998 /lib | |
parent | 55897415066e96bb89ecdc68a59a2ce8de302eae (diff) | |
parent | fbd479b68e2c58068666f738a009ef7a1ca8abde (diff) | |
download | zsh-ac838345f5cd0f440bd75dfc98c98b9691b03164.tar.gz zsh-ac838345f5cd0f440bd75dfc98c98b9691b03164.tar.bz2 zsh-ac838345f5cd0f440bd75dfc98c98b9691b03164.zip |
Merge pull request #2270 from michaelorr/slow-git-fix
Optionally disable git_prompt_info with git config option for very large repos
Diffstat (limited to 'lib')
-rw-r--r-- | lib/git.zsh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/git.zsh b/lib/git.zsh index df0fcedbb..305a77aff 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -1,8 +1,10 @@ # get the name of the branch we are on function git_prompt_info() { - ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ - ref=$(command git rev-parse --short HEAD 2> /dev/null) || return - echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" + if [[ "$(git config --get oh-my-zsh.hide-status)" != "1" ]]; then + ref=$(command git symbolic-ref HEAD 2> /dev/null) || \ + ref=$(command git rev-parse --short HEAD 2> /dev/null) || return + echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX" + fi } |