From b55776e7aa7cb4db2e782285fa35473c51de6940 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 2 Jun 2015 20:16:27 +0300 Subject: [PATCH] fix: do the PURE_GIT_PULL check in the correct place --- pure.zsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pure.zsh b/pure.zsh index 7f6f082..f6fd34d 100644 --- a/pure.zsh +++ b/pure.zsh @@ -201,16 +201,17 @@ prompt_pure_async_tasks() { # only perform tasks inside git working tree [[ "${working_tree}" != "" ]] || return - # tell worker to do a git fetch - async_job "prompt_pure" prompt_pure_async_git_fetch "$working_tree" + if (( ${PURE_GIT_PULL:-1} )); then + # make sure working tree is not $HOME + [[ "${working_tree}" != "$HOME" ]] && + # tell worker to do a git fetch + async_job "prompt_pure" prompt_pure_async_git_fetch "$working_tree" + fi # if dirty checking is sufficiently fast, tell worker to check it again, or wait for timeout local dirty_check=$(( $EPOCHSECONDS - ${prompt_pure_git_delay_dirty_check:-0} )) if (( $dirty_check > ${PURE_GIT_DELAY_DIRTY_CHECK:-1800} )); then unset prompt_pure_git_delay_dirty_check - (( ${PURE_GIT_PULL:-1} )) && - # make sure working tree is not $HOME - [[ "${working_tree}" != "$HOME" ]] && # check check if there is anything to pull async_job "prompt_pure" prompt_pure_async_git_dirty "${PURE_GIT_UNTRACKED_DIRTY:-1}" "$working_tree" fi