pull-repos: git pull should go before

imagine the branch is new and does not exist
This commit is contained in:
pedro 2024-01-24 15:04:32 +01:00
parent 5146a6f9be
commit b7ba1d6a7f
1 changed files with 1 additions and 1 deletions

View File

@ -14,13 +14,13 @@ _pull() {
if [ -d "${mydir}" ]; then
cd "${mydir}"
git pull
current_branch="$(git branch --show-current)"
# ensure we are in the right branch without invalidating docker build cache
# yes, even without no branch switch and no new commits
if [ ! "${current_branch}" = "${expected_branch}" ]; then
git checkout "${expected_branch}"
fi
git pull
cd -
else
git clone -b "${expected_branch}" "${myurl}" "${mydir}"