From 366b527757529bd9b107fce128455ac1cda776f6 Mon Sep 17 00:00:00 2001 From: Matthias Kurz Date: Fri, 4 Nov 2022 01:56:15 +0100 Subject: [PATCH] libmakepkg: make sure git cloned repo's remote is named origin makepkg assumes that the remote git repo is named "origin" at several places in its handling of git sources. It is possible to set the remote repo name since git v2.30.0 (with bug fix for bare checkouts in v2.30.2). Add "--origin=origin" to all git clone commands. Signed-off-by: Allan McRae --- scripts/libmakepkg/source/git.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in index d2640092..22b4eebd 100644 --- a/scripts/libmakepkg/source/git.sh.in +++ b/scripts/libmakepkg/source/git.sh.in @@ -48,7 +48,7 @@ download_git() { if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git" - if ! git clone ${GITFLAGS:---mirror} "$url" "$dir"; then + if ! git clone --origin=origin ${GITFLAGS:---mirror} "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" plainerr "$(gettext "Aborting...")" exit 1 @@ -91,7 +91,7 @@ extract_git() { exit 1 fi cd_safe "$srcdir" - elif ! git clone -s "$dir" "${dir##*/}"; then + elif ! git clone --origin=origin -s "$dir" "${dir##*/}"; then error "$(gettext "Failure while creating working copy of %s %s repo")" "${repo}" "git" plainerr "$(gettext "Aborting...")" exit 1