# first result is to be ignored, but we use it to check status
git ls-remote "$1" refs/heads/master >/dev/null 2>&1 || return 1
# if we can't time, we only check availability
- if ! { time -p sh -c 'true'; } >/dev/null 2>&1; then
+ if ! $have_time; then
echo 0
return
fi
(
set +x
export REPO=$1 # so that the sh -c subshell can use it
- { time -p 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
+ { 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
)
}
fi
o=`git config xonotic.all.mirrorselection 2>/dev/null || true`
git config xonotic.all.mirrorselection try_same
- verbose git clone "$url" "$d0/$d"
+ verbose git clone --branch "$branch" "$url" "$d0/$d"
git config xonotic.all.mirrorselection "$o"
enter "$d0/$d" verbose
fix_git_config "$url" "$pushurl"
- if [ "$branch" != "master" ]; then
- verbose git checkout --track -b "$branch" origin/"$branch"
- fi
cd "$d0"
fi
}