]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - all
./all clean --reclone
[xonotic/xonotic.git] / all
diff --git a/all b/all
index 14af58c4b8d4e8d57e8c65c64fe5627fdc53ae00..12e4501f82fd92aabf5797b47691342d80b9271b 100755 (executable)
--- a/all
+++ b/all
@@ -900,8 +900,15 @@ case "$cmd" in
                killbranches=false
                # usage:
                #   ./all clean [-m] [-f | -fu] [-r] [-D]
+               #   ./all clean --reclone
                while :; do
-                       if [ x"$1" = x"-f" ]; then
+                       if [ x"$1" = x"--reclone" ]; then
+                               force=true
+                               gotoupstream=true
+                               gotomaster=true
+                               rmuntracked=true
+                               killbranches=true
+                       elif [ x"$1" = x"-f" ]; then
                                force=true
                        elif [ x"$1" = x"-u" ]; then
                                gotoupstream=true
@@ -928,7 +935,7 @@ case "$cmd" in
                                fi
                                if $gotomaster; then
                                        verbose git checkout -f "`repobranch "$d"`"
-                                       git reset --hard origin/"`repobranch "$d"`"
+                                       verbose git reset --hard origin/"`repobranch "$d"`"
                                else
                                        r=`git symbolic-ref HEAD`
                                        r=${r#refs/heads/}
@@ -961,7 +968,9 @@ case "$cmd" in
                        fi
                        if $killbranches; then
                                git for-each-ref --format='%(refname)' refs/heads/ | while IFS= read -r B; do
-                                       git branch -D "${B#refs/heads/}" 2>/dev/null
+                                       if [ x"$B" != x"`git symbolic-ref HEAD`" ]; then
+                                               verbose git branch -D "${B#refs/heads/}"
+                                       fi
                                done
                        fi
                done