Skip to content

Commit fc4b3b6

Browse files
authored
Merge pull request #140 from edx/pwnage101/repo-script-shallow-clone-track-branches
feat: repo.sh - shallow cloning still tracks remote branches.
2 parents fa6c178 + 4acb0ba commit fc4b3b6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

repo.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,11 @@ _clone ()
164164
fi
165165
if [ "${SHALLOW_CLONE}" == "1" ]; then
166166
git clone ${CLONE_BRANCH} -c core.symlinks=true --depth=1 "${repo}"
167+
# Set up developers for success by tracking all remote branches, otherwise remote branches
168+
# cannot be checked-out. This only edits a text file, so it adds negligible time.
169+
pushd "${name}"
170+
git remote set-branches origin '*'
171+
popd
167172
else
168173
git clone ${CLONE_BRANCH} -c core.symlinks=true "${repo}"
169174
fi

0 commit comments

Comments
 (0)