From fab8ab7617d4ba2eed4546e81b004ade5b739691 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 14 Apr 2021 22:50:02 +0200 Subject: git: Honor proxy settings when fetching submodules. Fixes . * 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. --- doc/guix.texi | 3 ++- 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. -- cgit 1.4.1