forked from kiss-community/kiss
kiss: Do a shallow clone unless checking out a hash
This commit is contained in:
parent
632d3cf721
commit
445ba5ead5
14
kiss
14
kiss
@ -150,12 +150,18 @@ pkg_sources() {
|
|||||||
# This is a checksums check, skip it.
|
# This is a checksums check, skip it.
|
||||||
[ "$2" ] && continue
|
[ "$2" ] && continue
|
||||||
|
|
||||||
repo_src=${src##git+}
|
|
||||||
|
|
||||||
mkdir -p "$mak_dir/$1/$dest"
|
mkdir -p "$mak_dir/$1/$dest"
|
||||||
|
|
||||||
(cd "$mak_dir/$1/$dest" && git clone "${repo_src%#*}" .) ||
|
# Run in a subshell to keep variables local.
|
||||||
die "$1" "Failed to clone $src"
|
(
|
||||||
|
repo_src=${src##git+}
|
||||||
|
|
||||||
|
[ "${src##*#*}" ] && shallow=--depth=1
|
||||||
|
|
||||||
|
cd "$mak_dir/$1/$dest" &&
|
||||||
|
git clone "${shallow:---}" "${repo_src%#*}" .
|
||||||
|
|
||||||
|
) || die "$1" "Failed to clone $src"
|
||||||
|
|
||||||
# Remote source.
|
# Remote source.
|
||||||
elif [ -z "${src##*://*}" ]; then
|
elif [ -z "${src##*://*}" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user