blob: bb8170d7f69280caf15314662de7630200430dfc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
set -e
scriptDir="$( dirname "$0" )"
source "$scriptDir/git-base.sh"
echo "\nTest: Root of this git repo"
echo "$(git_root)"
echo "\nTest: Location of .git"
echo "$(dot_git)"
echo "\nTest: Record the timestamp"
record_timestamp
echo "Timestamp = $(timestamp)"
echo "Time now = $(time_now)"
echo "\nTest: Time to update when just recorded"
if time_to_update; then
echo "time to update"
else
echo "not time yet"
fi
echo "\nTest: Don't fetch if it's not time to update"
fetch_async "debug"
echo "\nTest: Time to update when timestamp 5 mins ago"
touch -A "-010000" "$(dot_git)/lastupdatetime"
if time_to_update; then
echo "time to update"
else
echo "not time yet"
fi
echo "\nTest: Do a non-blocking git fetch"
fetch_async "debug"
echo "Did I block?"
|