Переглянути джерело

git pull if the repo is already there

Ian Goldberg 4 місяців тому
батько
коміт
38ffde151e
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      repro/build-all-dockers

+ 4 - 2
repro/build-all-dockers

@@ -19,9 +19,11 @@ clone_or_update() {
     repodir="$2"
     tag="$3"
     if [ -d comps/${repodir}/.git ]; then
-        ( cd comps/${repodir} && git fetch --tags -f origin && git checkout $tag ) || exit 1
+        ( cd comps/${repodir} && git fetch --tags -f origin && \
+            git checkout $tag && git pull ) || exit 1
     else
-        ( cd comps && git clone ${repourl} ${repodir} && cd ${repodir} && git checkout $tag ) || exit 1
+        ( cd comps && git clone ${repourl} ${repodir} && cd ${repodir} && \
+            git checkout $tag ) || exit 1
     fi
 }