From: Rudolf Polzer Date: Wed, 27 Jul 2011 17:53:34 +0000 (+0200) Subject: offer to get rid of in-the-way directories X-Git-Tag: xonotic-v0.5.0~50 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3b0856842e3eb2b6641e08b151d6cf98e686f7f1;p=xonotic%2Fxonotic.git offer to get rid of in-the-way directories --- diff --git a/all b/all index 29928197..9e1f3ec2 100755 --- a/all +++ b/all @@ -380,7 +380,7 @@ fix_upstream_rebase_mergefail() fix_git_config() { - if ! [ -d ".git" ]; then + if ! [ -f ".git/config" ]; then $ECHO "Not a git repository. Bailing out to not cause damage." exit 1 fi @@ -698,7 +698,7 @@ case "$cmd" in url=`repourl "$d"` pushurl=`repopushurl "$d"` branch=`repobranch "$d"` - if [ -d "$d0/$d" ]; then + if [ -f "$d0/$d/.git/config" ]; then # if we have .no file, skip if [ -f "$d0/$d.no" ]; then msg "Repository $d disabled by a .no file, delete $d.no to enable; thus, not updated" @@ -726,6 +726,14 @@ case "$cmd" in cd "$d0" fi else + if [ -d "$d0/$d" ]; then + if yesno "$d0/$d is in the way, get rid of it?"; then + verbose rm -rf "$d0/$d" + else + echo "Note: $d0/$d will stay broken." + continue + fi + fi verbose git clone "$url" "$d0/$d" enter "$d0/$d" verbose fix_git_config "$url" "$pushurl"