diff --git a/repo.sh b/repo.sh index 8f3602d809..b98d99dcf0 100755 --- a/repo.sh +++ b/repo.sh @@ -75,8 +75,15 @@ non_release_ssh_repos=( "git@github.com:openedx/frontend-app-profile.git" "git@github.com:openedx/frontend-app-ora-grading.git" ) -# Space separated list of repos that use 2u specific branch -twou_main_repos="ecommerce yourownrepo" +# Space separated list of repos that use 2u specific branch should be +# set in your environment. example: +# export TWOU_MAIN_REPOS="ecommerce yourownrepo" +# +# If TWOU_MAIN_REPOS is set in the env, then TWOU_CHECKOUT_BRANCH must +# also be set. Here is an example of how to update your bashrc +# file, so that you can get these variables created (note, TWOU_MAIN_REPOS +# likely will grow over time, and not just use ecommerce'): +# $ echo -e "\nexport TWOU_CHECKOUT_BRANCH=\"2u/main\"\nexport TWOU_MAIN_REPOS=\"ecommerce yourownrepo\"" >> ~/.bash_profile if [ -n "${OPENEDX_RELEASE}" ]; then OPENEDX_GIT_BRANCH=open-release/${OPENEDX_RELEASE} @@ -135,14 +142,14 @@ _clone () _checkout_and_update_branch cd .. else - if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${twou_main_repos}" | grep -o "${name}"; then + if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${TWOU_MAIN_REPOS}" | grep -o "${name}"; then CLONE_BRANCH="-b ${TWOU_CHECKOUT_BRANCH}" elif [ -n "${OPENEDX_GIT_BRANCH:-}" ]; then CLONE_BRANCH="-b ${OPENEDX_GIT_BRANCH}" else CLONE_BRANCH="" fi - echo "CLONE_BRANCH is ${CLONE_BRANCH}" + if [ "${SHALLOW_CLONE}" == "1" ]; then git clone ${CLONE_BRANCH} -c core.symlinks=true --depth=1 "${repo}" else @@ -158,7 +165,7 @@ _checkout_and_update_branch () GIT_SYMBOLIC_REF="$(git symbolic-ref HEAD 2>/dev/null)" BRANCH_NAME=${GIT_SYMBOLIC_REF##refs/heads/} - if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${twou_main_repos}" | grep -o "${name}"; then + if [ -n "${TWOU_CHECKOUT_BRANCH}" ] && echo "${TWOU_MAIN_REPOS}" | grep -o "${name}"; then CHECKOUT_BRANCH="${TWOU_CHECKOUT_BRANCH}" elif [ -n "${OPENEDX_GIT_BRANCH}" ]; then CHECKOUT_BRANCH=${OPENEDX_GIT_BRANCH}