z/GitAuto-fetch.zsh: fixed always touch and fixed lag for fetch

This commit is contained in:
Oliver Schraml 2019-12-18 14:23:09 +01:00
parent b940daa0b2
commit 5ec38079ea
1 changed files with 2 additions and 2 deletions

View File

@ -5,8 +5,8 @@ function git-fetch-all {
dir=`command git rev-parse --git-dir` && dir=`command git rev-parse --git-dir` &&
[[ ! -f $dir/.no_auto_fetch ]] && [[ ! -f $dir/.no_auto_fetch ]] &&
(( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $git_auto_fetch_interval )) && (( `date +%s` - `date -r $dir/FETCH_LOG +%s 2>/dev/null || echo 0` > $git_auto_fetch_interval )) &&
GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \ ( GIT_SSH_COMMAND="command ssh -o BatchMode=yes" \
command git fetch >/dev/null 2>&1 ; touch $dir/FETCH_LOG &) command git fetch >/dev/null 2>&1 & touch $dir/FETCH_LOG & ))
} }
function git-auto-fetch { function git-auto-fetch {