abuild: Respect $reporev variable when fetching git repositories

For git repositories the $reporev variable is not really used since the
$_rev variable is passed to git and $_rev was only set when $reporev was
empty.
This commit is contained in:
Sören Tempel 2016-02-11 14:26:08 +01:00
parent 8d272af174
commit 578ab740ad

View File

@ -2038,7 +2038,8 @@ snapshot() {
local _version=${verbase:-0}_git${_date}
command -v git >/dev/null || \
die "Missing git! Install git to support git clone."
[ -z "$reporev" ] && local _rev="HEAD" && local _depth="--depth=1"
local _rev="${reporev:-HEAD}"
[ "$_rev" = "HEAD" ] && local _depth="--depth=1"
msg "Creating git snapshot: $pkgname-$_version"
git clone $_depth --bare $giturl $pkgname-$_version || return 1
git --git-dir $pkgname-$_version archive \