fix: do the PURE_GIT_PULL check in the correct place

This commit is contained in:
Mathias Fredriksson
2015-06-02 20:16:27 +03:00
parent 77e0633639
commit b55776e7aa

View File

@@ -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