Update "git fetch" with intelligence about when to go fetch (ie, if we don't have the ref specified)
This commit is contained in:
parent
9a4bbd34b2
commit
143ac14d2a
5
build.sh
5
build.sh
|
|
@ -147,7 +147,10 @@ for repoTag in "${repos[@]}"; do
|
|||
git clone -q "$gitUrl" "$gitRepo"
|
||||
echo 'Cloned successfully!'
|
||||
else
|
||||
( cd "$gitRepo" && git fetch -q && git fetch -q --tags )
|
||||
# if we don't have the "ref" specified, "git fetch" in the hopes that we get it
|
||||
if ! ( cd "$gitRepo" && git rev-parse --verify "${gitRef}^{commit}" &> /dev/null ); then
|
||||
( cd "$gitRepo" && git fetch -q && git fetch -q --tags )
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue