detect broken clones and delete them

This commit is contained in:
Rudolf Polzer 2012-01-31 21:54:18 +01:00
parent 52a7995f8f
commit a7aecff143

6
all
View File

@ -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"