cros.sh: mirror => bare

This commit is contained in:
Hui Yiqun 2018-01-22 15:58:08 +08:00
parent a448e09d0f
commit e951ebd6ba

View File

@ -18,8 +18,8 @@ function contains() {
function git_clone_or_pull {
URL=$1
DIRECTORY=$2
MIRROR=$3
if [[ -z $MIRROR ]]; then
BARE=$3
if [[ -z $BARE ]]; then
if [[ -d $DIRECTORY ]]; then
git -C $DIRECTORY pull
else
@ -27,9 +27,9 @@ function git_clone_or_pull {
fi
else
if [[ -d $DIRECTORY ]]; then
git -C $DIRECTORY remote update
git -C $DIRECTORY fetch --force --prune
else
git clone --mirror $URL $DIRECTORY
git clone --bare $URL $DIRECTORY
fi
fi
}