lib: retry git fetch a few times (take 2)
Wrap the failure in a if statement. Otherwise it will fail the first time because the script runs under -e
This commit is contained in:
parent
56fb137646
commit
f6da41ec8e
1 changed files with 6 additions and 3 deletions
|
@ -26,9 +26,12 @@ if ! [[ "$ref" =~ ^refs/ ]] ; then
|
||||||
ref=refs/heads/$ref
|
ref=refs/heads/$ref
|
||||||
fi
|
fi
|
||||||
for retry in 1 2 3 ; do
|
for retry in 1 2 3 ; do
|
||||||
timeout 15m git fetch --update-head-ok origin +$ref:$ref && break
|
if timeout 15m git fetch --update-head-ok origin +$ref:$ref ; then
|
||||||
echo "Retry git fetch in 60 seconds"
|
break
|
||||||
sleep 60
|
else
|
||||||
|
echo "Retry git fetch in 60 seconds"
|
||||||
|
sleep 60
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
git fetch --update-head-ok origin +$ref:$ref
|
git fetch --update-head-ok origin +$ref:$ref
|
||||||
git switch --force-create $v $ref
|
git switch --force-create $v $ref
|
||||||
|
|
Loading…
Add table
Reference in a new issue