File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -769,6 +769,24 @@ function fetch_repo_from_git() {
769769 logmust git show-ref repo-HEAD
770770 logmust git show-ref upstream-HEAD
771771 else
772+
773+ #
774+ # The "os-upgrade" branch is used for Ubuntu version upgrade projects. As such, the following
775+ # block of code will only be executed if the `PACKAGE_GIT_BRANCH` is set to "os-upgrade". Not
776+ # all product repositories are required to have an "os-upgrade" branch, because some packages
777+ # will successfully build on the new Ubuntu version as well as the old without any changes.
778+ # To allow engineering to create the "os-upgrade" branch only in repositories that require
779+ # changes for the new Ubuntu version, this block of code will check if the "os-upgrade" branch
780+ # exists in the repository and if it does not, it will build off of "develop" instead.
781+ #
782+ if [[ " $PACKAGE_GIT_BRANCH " == " os-upgrade" ]]; then
783+ git_fetch_helper " $PACKAGE_GIT_URL " --no-tags " $PACKAGE_GIT_BRANCH " --depth=1 && branchexists=0 || branchexists=1
784+ if [[ branchexists -ne 0 ]]; then
785+ echo " NOTE: The branch 'os-upgrade' does not exist for this repo. Using 'develop' instead."
786+ PACKAGE_GIT_BRANCH=" develop"
787+ fi
788+ fi
789+
772790 logmust git_fetch_helper " $PACKAGE_GIT_URL " --no-tags \
773791 " +$PACKAGE_GIT_BRANCH :repo-HEAD" --depth=1
774792 logmust git show-ref repo-HEAD
You can’t perform that action at this time.
0 commit comments