diff options
author | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-19 14:28:43 +0000 |
---|---|---|
committer | dylan.araps@gmail.com <dylan.araps@gmail.com> | 2020-02-19 14:28:43 +0000 |
commit | 929283edb08cbe965637c033ac32c93a243044ea (patch) | |
tree | 429e6d6de5405473ce0e607835855b5b4ac34ba0 | |
parent | 56a6186d072aba6d1ada877603644087c0bce216 (diff) | |
download | cpt-929283edb08cbe965637c033ac32c93a243044ea.tar.gz |
kiss: Fix old behavior
FossilOrigin-Name: 4ed7c978a2ca59433dd20757bd2eb73b0d069188109dd8e914975822206a9d98
-rwxr-xr-x | kiss | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -199,15 +199,27 @@ pkg_sources() { # beforehand. cd "$mak_dir/$1/$dest" || die 2>/dev/null + # Clear the argument list as we'll be overwriting + # it below based on what kind of checkout we're + # dealing with. + set -- "$repo_src" + # If a branch was given, shallow clone it directly. # This speeds things up as we don't have to grab # a lot of unneeded commits. - [ "${src##*@*}" ] && set -- || + [ "${src##*@*}" ] || set -- -b "${src##*@}" "${repo_src%@*}" + # Maintain compatibility with older versions of + # kiss by shallow cloning all branches. This has + # the added benefit of allowing checkouts of + # specific commits in specific branches. + [ "${src##*#*}" ] || + set -- --no-single-branch "${repo_src%#*}" + # Always do a shallow clone as we will unshallow it if # needed later (when a commit is desired). - git clone --depth=1 "${@:-${repo_src%#*}}" . + git clone --depth=1 "$@" . ) || die "$1" "Failed to clone $src" |