diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-04-14 22:50:02 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-04-14 22:51:38 +0200 |
commit | fab8ab7617d4ba2eed4546e81b004ade5b739691 (patch) | |
tree | 1110e50701a09924f6774900ff85d4b716444d76 | |
parent | 70c2897ea39b8633f7b71324025954e43b4ed055 (diff) | |
download | guix-fab8ab7617d4ba2eed4546e81b004ade5b739691.tar guix-fab8ab7617d4ba2eed4546e81b004ade5b739691.tar.gz |
git: Honor proxy settings when fetching submodules.
Fixes <https://bugs.gnu.org/44593>.
* guix/git.scm (update-submodules): Add #:fetch-options and honor it.
(update-cached-checkout): Pass #:fetch-options to 'update-submodules'.
* doc/guix.texi (Requirements): Adjust comment about Guile-Git.
-rw-r--r-- | doc/guix.texi | 3 | ||||
-rw-r--r-- | guix/git.scm | 10 |
2 files changed, 9 insertions, 4 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 1069a5d296..58bcfbdbb5 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -848,7 +848,8 @@ version 0.1.0 or later; @item @uref{https://notabug.org/guile-lzlib/guile-lzlib, Guile-lzlib}; @item @uref{https://www.nongnu.org/guile-avahi/, Guile-Avahi}; @item -@c FIXME: Specify a version number once a release has been made. +@c FIXME: We need the #:fetch-options parameter of 'submodule-update', +@c which appeared in 0.5.0. Change below after string freeze. @uref{https://gitlab.com/guile-git/guile-git, Guile-Git}, version 0.3.0 or later; @item @uref{https://savannah.nongnu.org/projects/guile-json/, Guile-JSON} diff --git a/guix/git.scm b/guix/git.scm index 776b03f33a..57fa2ca1ee 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -283,13 +283,15 @@ dynamic extent of EXP." (report-git-error err)))) (define* (update-submodules repository - #:key (log-port (current-error-port))) + #:key (log-port (current-error-port)) + (fetch-options #f)) "Update the submodules of REPOSITORY, a Git repository object." (for-each (lambda (name) (let ((submodule (submodule-lookup repository name))) (format log-port (G_ "updating submodule '~a'...~%") name) - (submodule-update submodule) + (submodule-update submodule + #:fetch-options fetch-options) ;; Recurse in SUBMODULE. (let ((directory (string-append @@ -297,6 +299,7 @@ dynamic extent of EXP." "/" (submodule-path submodule)))) (with-repository directory repository (update-submodules repository + #:fetch-options fetch-options #:log-port log-port))))) (repository-submodules repository))) @@ -397,7 +400,8 @@ it unchanged." (remote-fetch (remote-lookup repository "origin") #:fetch-options (make-default-fetch-options))) (when recursive? - (update-submodules repository #:log-port log-port)) + (update-submodules repository #:log-port log-port + #:fetch-options (make-default-fetch-options))) ;; Note: call 'commit-relation' from here because it's more efficient ;; than letting users re-open the checkout later on. |