pull-repos: git pull should go before
imagine the branch is new and does not exist
This commit is contained in:
parent
5146a6f9be
commit
b7ba1d6a7f
|
@ -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}"
|
||||
|
|
Reference in a new issue