diff --git a/build.sh b/build.sh index e32d652..0587a09 100755 --- a/build.sh +++ b/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