mirror of https://github.com/akelge/zsh
15 lines
327 B
Bash
15 lines
327 B
Bash
local _gitdir
|
|
local last_fetch
|
|
local diff
|
|
|
|
cd $1
|
|
|
|
gitdir=$(git rev-parse --git-dir 2> /dev/null) || return 0
|
|
last_fetch=$(zstat +mtime $gitdir/FETCH_HEAD 2> /dev/null || echo 0)
|
|
let "diff = $(strftime %s) - $last_fetch"
|
|
[ $diff -gt ${GIT_FETCH_INTERVAL:-30} ] && git fetch --all -p
|
|
|
|
return 0
|
|
|
|
# vim: set ts=2 sw=2 tw=0 ft=sh :
|