clone.sh: When calculating REPO_REFSPEC for topic, don't swallow errors
There can be unlimited number of unexpected errors, e.g. we had a case when
SSH failing due to key type mismatch (TFC-459). Suh should not be swallowed,
as that can be potentially lead to a case when completely different refspec
would be tested than expected. Instead, any expected conditions when
REPO_REFSPEC may lead to not a valid value (to be replaced with a default)
should be handled explicitly.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: I35078258eef051306f45d18369f32b74e7bc36a2
diff --git a/scripts/clone.sh b/scripts/clone.sh
index 7885c32..1680b29 100755
--- a/scripts/clone.sh
+++ b/scripts/clone.sh
@@ -103,7 +103,7 @@
if [ -n "${GERRIT_TOPIC}" -a "${REPO_HOST}" = "${GERRIT_HOST}" -a "${GERRIT_PROJECT}" != "${REPO_PROJECT}" ]; then
echo "Got Gerrit Topic: ${GERRIT_TOPIC}"
REPO_REFSPEC="$(ssh ${SSH_PARAMS} ${CI_BOT_USERNAME}@${REPO_HOST#https://} gerrit query ${GERRIT_QUERY_PARAMS} \
- project:${REPO_PROJECT} topic:${GERRIT_TOPIC} | ${SHARE_FOLDER}/${JOBS_REPO_NAME}/scripts/parse_refspec.py || true)"
+ project:${REPO_PROJECT} topic:${GERRIT_TOPIC} | ${SHARE_FOLDER}/${JOBS_REPO_NAME}/scripts/parse_refspec.py)"
if [ -z "${REPO_REFSPEC}" ]; then
REPO_REFSPEC="${REPO_DEFAULT_REFSPEC}"
echo "Roll back to \"${REPO_REFSPEC}\" for \"${REPO_PROJECT}\""