support/download/git: use FOO_DL_OPTS

The manual states that FOO_DL_OPTS are valid for all the different
download backends, but that is not the case: at least the git backend
does not use them (it does not fail, it just ignores them).

Accept FOO_DL_OPTS in the git backend, and pass them to 'git fetch'.
There is no way that we can pass such options to submodules or lfs,
though.

Update the manual accordingly.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit a1012b363a)
Signed-off-by: Thomas Perale <thomas.perale@mind.be>
This commit is contained in:
Yann E. MORIN
2025-04-09 22:03:43 +02:00
committed by Arnout Vandecappelle
parent fa99791948
commit fb287340b7
2 changed files with 6 additions and 4 deletions

View File

@@ -270,7 +270,9 @@ not and can not work as people would expect it should:
server-side checking for user logins and passwords, or to use a proxy.
All download methods valid for +LIBFOO_SITE_METHOD+ are supported;
valid options depend on the download method (consult the man page
for the respective download utilities).
for the respective download utilities). For git, +FOO_DL_OPTS+ will
only be passed to `git fetch` and no other git command (esp. not to
`git lfs fetch` or `git submodule update`).
* +LIBFOO_EXTRA_DOWNLOADS+ is a space-separated list of additional
files that Buildroot should download. If an entry contains +://+

View File

@@ -133,8 +133,8 @@ fi
_git remote set-url origin "'${uri}'"
printf "Fetching all references\n"
_git fetch origin
_git fetch origin -t -f
_git fetch "${@}" origin
_git fetch "${@}" origin -t -f
# Try to get the special refs exposed by some forges (pull-requests for
# github, changes for gerrit...). There is no easy way to know whether
@@ -143,7 +143,7 @@ _git fetch origin -t -f
# below, if there is an issue anyway. Since most of the cset we're gonna
# have to clone are not such special refs, consign the output to oblivion
# so as not to alarm unsuspecting users, but still trace it as a warning.
if ! _git fetch origin "'${cset}:${cset}'" >/dev/null 2>&1; then
if ! _git fetch "${@}" origin "'${cset}:${cset}'" >/dev/null 2>&1; then
printf "Could not fetch special ref '%s'; assuming it is not special.\n" "${cset}"
fi