From ae4ac2108b6425f286769edc24997a75405a04ed Mon Sep 17 00:00:00 2001 From: merakor Date: Fri, 2 Oct 2020 12:43:20 +0000 Subject: 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. FossilOrigin-Name: 5f8d147c298113f235c28b992e7dba0ec39d19eaae368e5cd7bc359cceb24ecb --- src/cpt-lib | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cpt-lib') diff --git a/src/cpt-lib b/src/cpt-lib index ebd55a0..6686a81 100644 --- 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" ;; -- cgit v1.2.3