makepkg: guard against undefined git pinned sources
If something like source=(..."#commit=") is used, e.g. due to failed
variable expansion, we try to check out an empty refspec as nothing at
all, and end up just running "git checkout". This happens because we
fail at variable expansion too -- so let's quote our variables properly
and make sure git sees this as an empty refspec, so it can error out.
Also make sure it is interpreted as a ref instead of a path.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
(cherry picked from commit 817f9fb715
)
This commit is contained in:
parent
12503767c0
commit
d69da08abe
1 changed files with 1 additions and 1 deletions
|
@ -125,7 +125,7 @@ extract_git() {
|
|||
fi
|
||||
|
||||
if [[ $ref != "origin/HEAD" ]] || (( updating )) ; then
|
||||
if ! git checkout --force --no-track -B makepkg $ref; then
|
||||
if ! git checkout --force --no-track -B makepkg "$ref" --; then
|
||||
error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git"
|
||||
plain "$(gettext "Aborting...")"
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Reference in a new issue