From bfaa63d61dfe9c7f6fbf4f06730325c43f387096 Mon Sep 17 00:00:00 2001 From: Peter Shipton Date: Wed, 13 Sep 2023 13:49:03 -0400 Subject: [PATCH] Modify get_source.sh to automatically fetch release branches If the current branch matches the pattern of a release branch, fetch openj9/omr branches of the same name. Signed-off-by: Peter Shipton --- closed/get_j9_source.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/closed/get_j9_source.sh b/closed/get_j9_source.sh index 8a6bebc7249..c5754c82a79 100644 --- a/closed/get_j9_source.sh +++ b/closed/get_j9_source.sh @@ -1,7 +1,7 @@ #!/bin/bash # =========================================================================== -# (c) Copyright IBM Corp. 2017, 2021 All Rights Reserved +# (c) Copyright IBM Corp. 2017, 2023 All Rights Reserved # =========================================================================== # # This code is free software; you can redistribute it and/or modify it @@ -57,10 +57,16 @@ declare -A shas declare -A references git_urls[openj9]=https://github.com/eclipse-openj9/openj9 -branches[openj9]=master - git_urls[omr]=https://github.com/eclipse-openj9/openj9-omr -branches[omr]=openj9 + +currentbranch=$(git rev-parse --abbrev-ref HEAD) +if [[ "$currentbranch" =~ v[0-9]+\.[0-9]+(\.[0-9]+)?-release ]] ; then + branches[openj9]=$currentbranch + branches[omr]=$currentbranch +else + branches[openj9]=master + branches[omr]=openj9 +fi pflag=false