]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/all/git.subr
Fix all "export" commands. Fixes some issues with weird shells.
[xonotic/xonotic.git] / misc / tools / all / git.subr
index 33054119e013680b08db65b02719556a3058f651..ac6594fbf8214f39f84974beec21906046bd1d21 100644 (file)
@@ -19,6 +19,10 @@ initrepo()
        base=
        pushbase=
        allrepos initrepo_ "`git config remote.origin.url`" "`git config remote.origin.pushurl`"
+       if [ -z "$base" ]; then
+               msg "The main repo is not xonotic.git, what have you done?"
+               exit 1
+       fi
        msg "Found main repo = $base"
        if [ -n "$pushbase" ]; then
                msg "Found push repo = $pushbase"
@@ -59,7 +63,7 @@ mirrorspeed()
        # now actually time it
        (
                set +x
-               export REPO=$1 # so that the sh -c subshell can use it
+               export REPO="$1" # so that the sh -c subshell can use it
                { measure_time sh -c 'git ls-remote "$REPO" refs/heads/master >/dev/null 2>&1'; } 2>&1 >/dev/null | head -n 1 | cut -d ' ' -f 2 | tr -d . | sed 's,^0*,,' | grep . || echo 0
                        # unit: clock ticks (depends on what "time" returns
        )