From d766c8b8d90a4bd748aef0873322611bc253b110 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Wed, 27 May 2015 19:30:12 +0300 Subject: [PATCH] use cd -q to prevent hooks from firing --- pure.zsh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pure.zsh b/pure.zsh index eb8cc00..222eb67 100644 --- a/pure.zsh +++ b/pure.zsh @@ -148,13 +148,15 @@ prompt_pure_async_git_dirty() { local umode="-unormal" [[ "$untracked_dirty" == "0" ]] && umode="-uno" - cd "$*" + # use cd -q to avoid side effects of changing directory, e.g. chpwd hooks + cd -q "$*" command test -n "$(git status --porcelain --ignore-submodules ${umode})" &>/dev/null (($? == 0)) && echo "*" } prompt_pure_async_git_fetch() { - cd "$*" + # use cd -q to avoid side effects of changing directory, e.g. chpwd hooks + cd -q "$*" # set GIT_TERMINAL_PROMPT=0 to disable auth prompting for git fetch (git 2.3+) GIT_TERMINAL_PROMPT=0 command git -c gc.auto=0 fetch