cpt

Carbs Packaging Tools
git clone git://git.carbslinux.org/cpt
Log | Files | Refs | README | LICENSE

commit f02c10a2ec7b40e74e6cf2f283092947b3c7af33
parent f91e612717dc129e19800cb1e8f5ea43bd44bc2f
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri,  2 Oct 2020 15:43:20 +0300

pkg_extract(): allow the usage of '@' for tags.

This change ensures that we don't have to acquire tags each time.
The user can specify https://blabla.git@v2 to acquire the v2 tag.
This is not needed for branches or commits.

Diffstat:
Msrc/cpt-lib | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/cpt-lib b/src/cpt-lib @@ -561,7 +561,11 @@ pkg_extract() { log "$1" "Cloning ${url%[@#]*}"; { git init git remote add origin "${url%[@#]*}" - git fetch "${com:+-t}" --depth=1 origin "$com" || git fetch + case "$url" in + # Tags are specified via '@' + *@*) git fetch -t --depth=1 origin "$com" || git fetch ;; + *) git fetch --depth=1 origin "$com" || git fetch + esac git checkout "${com:-FETCH_HEAD}" } || die "$1" "Failed to clone $src" ;;