git: Really enable timeouts when supported by Guile-Git.

This is a followup to 8bd013011d.

Previously, the call to ‘defined?’ would look for those bindings
in (current-module), where chances were that they would be missing;
consequently timeouts were never enabled.  This fixes that.

* guix/git.scm (set-git-timeouts)[defined?]: New procedure.

Change-Id: Ia14a351fd6d508f760992d7bb68d2f4bb61f8468
This commit is contained in:
Ludovic Courtès 2025-02-24 16:17:16 +01:00
parent 59167a010b
commit 48e0e6a127
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -219,6 +219,9 @@ when talking to remote Git servers.
If one of them is #f, the corresponding default setting is kept unchanged." If one of them is #f, the corresponding default setting is kept unchanged."
;; 'set-server-timeout!' & co. were added in Guile-Git 0.9.0. ;; 'set-server-timeout!' & co. were added in Guile-Git 0.9.0.
(define (defined? variable)
(module-defined? (resolve-interface '(git)) variable))
(when (and (defined? 'set-server-connection-timeout!) (when (and (defined? 'set-server-connection-timeout!)
connection-timeout) connection-timeout)
(set-server-connection-timeout! connection-timeout)) (set-server-connection-timeout! connection-timeout))