]> gitweb.fluxo.info Git - hydra.git/commitdiff
Init: check if repositories exist
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 20 Feb 2017 18:25:40 +0000 (15:25 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 20 Feb 2017 18:25:40 +0000 (15:25 -0300)
share/hydra/init

index 0c33ad322fac8a3785f3fdf4f895c3dc9a5a82b8..2caf1c58062dc226199869ad7440add007b74615 100755 (executable)
@@ -39,7 +39,9 @@ fi
 # Clone configuration repository or setup a new hydra
 if [ ! -z "$REMOTE" ]; then
   # Try to clone the superproject first
-  git clone $REMOTE $BASEDIR 2> /dev/null
+  if git ls-remote $REMOTE &> /dev/null; then
+    git clone $REMOTE $BASEDIR
+  fi
 
   (
     mkdir -p $BASEDIR
@@ -50,7 +52,11 @@ if [ ! -z "$REMOTE" ]; then
       if [ -e '.gitmodules' ] && grep -q \"config\" .gitmodules; then
         git submodule update --init $repo
       else
-        git clone ${REMOTE}/$repo `basename $repo .git`
+        if git ls-remote ${REMOTE}/$repo &> /dev/null; then
+          git clone ${REMOTE}/$repo `basename $repo .git`
+        else
+          echo "Skipping unavailable ${REMOTE}/$repo..."
+        fi
       fi
     done
   )