diff --git a/pull-repos.sh b/pull-repos.sh index b00f9c3..3495a24 100755 --- a/pull-repos.sh +++ b/pull-repos.sh @@ -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}"