From 63527d8e9bb18cd6bd2700ea084517dbb2854739 Mon Sep 17 00:00:00 2001 From: Chris Pappas Date: Mon, 29 Apr 2024 15:01:11 -0400 Subject: [PATCH 1/2] fix: point newly cloned ecommerce repos to use 2u/main branch --- repo.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/repo.sh b/repo.sh index ab123ac10b..b04cbbac75 100755 --- a/repo.sh +++ b/repo.sh @@ -139,6 +139,8 @@ _clone () else if [ -n "${OPENEDX_GIT_BRANCH:-}" ]; then CLONE_BRANCH="-b ${OPENEDX_GIT_BRANCH}" + elif [[ "${repo}" == *"openedx/ecommerce"* ]]; then + CLONE_BRANCH="-b 2u/main" else CLONE_BRANCH="" fi From babc862b2b6aaa0ef05d3ccc767da0b76e333f2a Mon Sep 17 00:00:00 2001 From: Chris Pappas Date: Wed, 1 May 2024 14:14:56 -0400 Subject: [PATCH 2/2] feat: make repeat runs of make dev.clone update from 2u/main for ecommerce --- repo.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/repo.sh b/repo.sh index b04cbbac75..0a30ba83ea 100755 --- a/repo.sh +++ b/repo.sh @@ -103,7 +103,7 @@ _checkout () # If a directory exists and it is nonempty, assume the repo has been cloned. if [ -d "$name" ] && [ -n "$(ls -A "$name" 2>/dev/null)" ]; then cd "$name" - _checkout_and_update_branch + _checkout_and_update_branch "${repo}" cd .. fi done @@ -134,7 +134,7 @@ _clone () fi printf "The [%s] repo is already checked out. Checking for updates.\n" "$name" cd "${DEVSTACK_WORKSPACE}/${name}" - _checkout_and_update_branch + _checkout_and_update_branch "${repo}" cd .. else if [ -n "${OPENEDX_GIT_BRANCH:-}" ]; then @@ -156,10 +156,13 @@ _clone () _checkout_and_update_branch () { + local current_repo=$1 GIT_SYMBOLIC_REF="$(git symbolic-ref HEAD 2>/dev/null)" BRANCH_NAME=${GIT_SYMBOLIC_REF##refs/heads/} if [ -n "${OPENEDX_GIT_BRANCH}" ]; then CHECKOUT_BRANCH=${OPENEDX_GIT_BRANCH} + elif [[ "${current_repo}" == *"openedx/ecommerce"* ]]; then + CHECKOUT_BRANCH="2u/main" else CHECKOUT_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@') fi