diff options
author | Michael Orr <michael.orr@coxinc.com> | 2013-11-20 12:30:55 -0500 |
---|---|---|
committer | Michael Orr <michael.orr@coxinc.com> | 2013-11-20 12:30:55 -0500 |
commit | fbd479b68e2c58068666f738a009ef7a1ca8abde (patch) | |
tree | b81fd4b605901d105a68c1f6e765951c762b4593 /lib | |
parent | 9f5a895192b7d6b75ba717ef4e2c9b6ed7977c68 (diff) | |
download | zsh-fbd479b68e2c58068666f738a009ef7a1ca8abde.tar.gz zsh-fbd479b68e2c58068666f738a009ef7a1ca8abde.tar.bz2 zsh-fbd479b68e2c58068666f738a009ef7a1ca8abde.zip |
adding a check for git config option to disable git_prompt_info() on a per repo basis
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 } |