build: fix unbound variable error in build artifact script (#46076)

We recently had a couple of issues with the shallowing of snapshot
git repositories. In an attempt to fix this, parts of the publish
script of the COMP repo have been used, but variables have not been
updated properly.

This commit fixes an unbound variable, avoiding errors when snapshots
are published for a new branch (e.g. when we branch-off).

PR Close #46076
This commit is contained in:
Paul Gschwendtner
2022-05-20 18:21:03 +00:00
committed by Alex Rickabaugh
parent c6d0d8c856
commit 8f68f53b67
+2 -2
View File
@@ -48,7 +48,7 @@ function publishRepo {
mkdir -p ${REPO_DIR}
echo "Starting cloning process of ${REPO_URL} into ${REPO_DIR}.."
(
if [[ $(git ls-remote --heads ${REPO_URL} ${BRANCH}) ]]; then
echo "Branch ${BRANCH} already exists. Cloning that branch."
@@ -57,7 +57,7 @@ function publishRepo {
cd ${REPO_DIR}
echo "Cloned repository and switched into the repository directory (${REPO_DIR})."
else
echo "Branch ${BRANCH} does not exist on ${packageRepo} yet."
echo "Branch ${BRANCH} does not exist on ${BUILD_REPO} yet."
echo "Cloning default branch and creating branch '${BRANCH}' on top of it."
git clone ${REPO_URL} ${REPO_DIR} --depth 1