From 727a6ef0097a4e23d4463f3cbd8d722fbb7bc9d2 Mon Sep 17 00:00:00 2001 From: Lan Xia Date: Thu, 30 Dec 2021 13:24:42 -0500 Subject: [PATCH] Support personal openj9 sha without branch (#3184) Currently, we take both OPENJ9_BRANCH and OPENJ9_SHA. However, in testenv.properties, we only output one value - OPENJ9_SHA (adoptium/TKG#255). We will not have branch information. The logic in `get.sh` was highly optimized to have minimal checkout for openj9 repo (i.e., we do not fetch other branches). This causes a problem as it is not able to git clone with sha only (if the sha is from other branch). This PR adds the support to git clone personal openj9 sha without branch info, so we can consume the OPENJ9_SHA without OPENJ9_BRNACH info. Related: https://github.com/adoptium/TKG/pull/255 Related: https://github.com/adoptium/aqa-tests/issues/2889 Signed-off-by: lanxia lan_xia@ca.ibm.com --- get.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/get.sh b/get.sh index 522ba27ddb..646a8e9473 100755 --- a/get.sh +++ b/get.sh @@ -484,7 +484,13 @@ getFunctionalTestMaterial() echo "git fetch -q --tags $OPENJ9_REPO +refs/pull/*:refs/remotes/origin/pr/*" git fetch -q --tags $OPENJ9_REPO +refs/pull/*:refs/remotes/origin/pr/* echo "git checkout -q $OPENJ9_SHA" - git checkout -q $OPENJ9_SHA + if ! git checkout $OPENJ9_SHA; then + echo "SHA not yet found. Continue fetching all the branches on origin..." + echo "git fetch -q --tags $OPENJ9_REPO +refs/heads/*:refs/remotes/origin/*" + git fetch -q --tags $OPENJ9_REPO +refs/heads/*:refs/remotes/origin/* + echo "git checkout -q $OPENJ9_SHA" + git checkout $OPENJ9_SHA + fi fi cd $TESTDIR fi