diff options
Diffstat (limited to 'guix')
-rw-r--r-- | guix/git.scm | 21 | ||||
-rw-r--r-- | guix/scripts/deploy.scm | 2 | ||||
-rw-r--r-- | guix/scripts/system/reconfigure.scm | 2 |
3 files changed, 20 insertions, 5 deletions
diff --git a/guix/git.scm b/guix/git.scm index a12f1eec8e..ca5dbfba1c 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> +;;; Copyright © 2017, 2020 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. @@ -108,6 +108,10 @@ the 'SSL_CERT_FILE' and 'SSL_CERT_DIR' environment variables." (string-append "R:" url) url)))))) +;; Authentication appeared in Guile-Git 0.3.0, check if it is available. +(define auth-supported? + (false-if-exception (resolve-interface '(git auth)))) + (define (clone* url directory) "Clone git repository at URL into DIRECTORY. Upon failure, make sure no empty directory is left behind." @@ -119,7 +123,13 @@ make sure no empty directory is left behind." ;; value in Guile-Git: <https://bugs.gnu.org/29238>. (if (module-defined? (resolve-interface '(git)) 'clone-init-options) - (clone url directory (clone-init-options)) + (let ((auth-method (and auth-supported? + (%make-auth-ssh-agent)))) + (clone url directory + (if auth-supported? + (make-clone-options + #:fetch-options (make-fetch-options auth-method)) + (clone-init-options)))) (clone url directory))) (lambda _ (false-if-exception (rmdir directory))))) @@ -281,7 +291,12 @@ When RECURSIVE? is true, check out submodules as well, if any." ;; Only fetch remote if it has not been cloned just before. (when (and cache-exists? (not (reference-available? repository ref))) - (remote-fetch (remote-lookup repository "origin"))) + (if auth-supported? + (let ((auth-method (and auth-supported? + (%make-auth-ssh-agent)))) + (remote-fetch (remote-lookup repository "origin") + #:fetch-options (make-fetch-options auth-method))) + (remote-fetch (remote-lookup repository "origin")))) (when recursive? (update-submodules repository #:log-port log-port)) (let ((oid (switch-to-ref repository canonical-ref))) diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index bc0ceabd3f..ad05c333dc 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 David Thompson <davet@gnu.org> -;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> +;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org> ;;; ;;; This file is part of GNU Guix. ;;; diff --git a/guix/scripts/system/reconfigure.scm b/guix/scripts/system/reconfigure.scm index 2f9dbb2508..77a72307b4 100644 --- a/guix/scripts/system/reconfigure.scm +++ b/guix/scripts/system/reconfigure.scm @@ -5,7 +5,7 @@ ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2019 Christopher Baines <mail@cbaines.net> -;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.lonestar.org> +;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org> ;;; ;;; This file is part of GNU Guix. ;;; |