File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11{
22 "name" : " External Git Repository in Codespace" ,
33 "id" : " external-repository" ,
4- "version" : " 3.0.0 " ,
4+ "version" : " 3.0.1 " ,
55 "description" : " Configures Codespace to work with an external Git repository" ,
66 "options" : {
77 "gitProvider" : {
Original file line number Diff line number Diff line change @@ -11,8 +11,28 @@ checkout_branch() {
1111 if [[ " ${AZDO_BRANCH} " == " " ]]; then
1212 return
1313 fi
14- echo " Checking out branch ${AZDO_BRANCH} "
1514 cd ${1}
15+
16+ # Get the current branch name
17+ CURRENT_BRANCH=$( git branch --show-current)
18+ if [[ " ${CURRENT_BRANCH} " == " ${AZDO_BRANCH} " ]]; then
19+ echo " Already on branch ${AZDO_BRANCH} "
20+ return
21+ fi
22+
23+ echo " Checking out branch ${AZDO_BRANCH} "
24+
25+ if [ ! -f ${HOME} /ado-auth-helper ]; then
26+ echo " Waiting up to 180 seconds for ado-auth-helper extension to be installed"
27+ fi
28+ # Wait up to 3 minutes for the ado-auth-helper to be installed
29+ for i in {1..180}; do
30+ if [ -f ${HOME} /ado-auth-helper ]; then
31+ break
32+ fi
33+ sleep 1
34+ done
35+
1636 # fetch the branch named AZDO_BRANCH
1737 git fetch origin ${AZDO_BRANCH}
1838 git checkout ${AZDO_BRANCH}
Original file line number Diff line number Diff line change 66source dev-container-features-test-lib
77
88# Definition specific tests
9+ touch ${HOME} /ado-auth-helper
910check " git-config" grep " ado-auth-helper" <( cat /tmp/branch-repos/.git/config)
1011check " branch" grep " joshaber/parallel-execution-schema" <( git -C /tmp/branch-repos branch --show-current)
1112
You can’t perform that action at this time.
0 commit comments