]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
when fixing configs, bail out if the repo is somehow invalid
authorRudolf Polzer <divverent@xonotic.org>
Wed, 27 Jul 2011 17:50:16 +0000 (19:50 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 27 Jul 2011 17:50:16 +0000 (19:50 +0200)
all

diff --git a/all b/all
index ce391b21e617a0d9dfbe16ee4b28f48febd36c95..29928197ae8b4fdd86e78f6da91f23982c8b0e6d 100755 (executable)
--- a/all
+++ b/all
@@ -380,6 +380,10 @@ fix_upstream_rebase_mergefail()
 
 fix_git_config()
 {
+       if ! [ -d ".git" ]; then
+               $ECHO "Not a git repository. Bailing out to not cause damage."
+               exit 1
+       fi
        verbose git config remote.origin.url "$1"
        if [ -n "$2" ]; then
                verbose git config remote.origin.pushurl "$2"