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
3
build.sh
3
build.sh
|
|
@ -147,9 +147,12 @@ for repoTag in "${repos[@]}"; do
|
||||||
git clone -q "$gitUrl" "$gitRepo"
|
git clone -q "$gitUrl" "$gitRepo"
|
||||||
echo 'Cloned successfully!'
|
echo 'Cloned successfully!'
|
||||||
else
|
else
|
||||||
|
# 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 )
|
( cd "$gitRepo" && git fetch -q && git fetch -q --tags )
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
repoGitRepo[$repo:$tag]="$gitRepo"
|
repoGitRepo[$repo:$tag]="$gitRepo"
|
||||||
repoGitRef[$repo:$tag]="$gitRef"
|
repoGitRef[$repo:$tag]="$gitRef"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue