mirror of
https://github.com/tuna/tunasync-scripts.git
synced 2025-04-20 04:12:42 +00:00
cros.sh: mirror => bare
This commit is contained in:
parent
a448e09d0f
commit
e951ebd6ba
8
cros.sh
8
cros.sh
@ -18,8 +18,8 @@ function contains() {
|
|||||||
function git_clone_or_pull {
|
function git_clone_or_pull {
|
||||||
URL=$1
|
URL=$1
|
||||||
DIRECTORY=$2
|
DIRECTORY=$2
|
||||||
MIRROR=$3
|
BARE=$3
|
||||||
if [[ -z $MIRROR ]]; then
|
if [[ -z $BARE ]]; then
|
||||||
if [[ -d $DIRECTORY ]]; then
|
if [[ -d $DIRECTORY ]]; then
|
||||||
git -C $DIRECTORY pull
|
git -C $DIRECTORY pull
|
||||||
else
|
else
|
||||||
@ -27,9 +27,9 @@ function git_clone_or_pull {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ -d $DIRECTORY ]]; then
|
if [[ -d $DIRECTORY ]]; then
|
||||||
git -C $DIRECTORY remote update
|
git -C $DIRECTORY fetch --force --prune
|
||||||
else
|
else
|
||||||
git clone --mirror $URL $DIRECTORY
|
git clone --bare $URL $DIRECTORY
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user