]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - all
detect broken clones and delete them
[xonotic/xonotic.git] / all
diff --git a/all b/all
index b451ac7d26f29254f61b9fddf260ce1511fe592b..6c9f306b70ee1cb0465d60ba14e6aba13d415655 100755 (executable)
--- a/all
+++ b/all
@@ -235,6 +235,12 @@ listrepos()
                        $ECHO "$d"
                        continue
                fi
+               # remove broken clones so they don't mess up stuff
+               if [ x"$d" != x"." ] && [ -d "$d" ] && ! [ -d "$d/.git" ]; then
+                       msg "$d exists but has no .git subdir. Probably a broken clone. Deleting."
+                       verbose rm -rf "$d"
+                       continue
+               fi
                # if we have the dir, always keep it
                if [ -d "$d" ]; then
                        msg "Repository $d enabled because it already exists"