aboutsummaryrefslogtreecommitdiff
path: root/guix/git-download.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2023-09-11 11:33:41 +0200
committerLudovic Courtès <ludo@gnu.org>2023-09-26 17:36:58 +0200
commitc7ed1e01600a5b37599ab50a30b2c41da646b1f4 (patch)
tree9998af53e0347b89d6bdd9b08847611b748bc939 /guix/git-download.scm
parent811b249397bd805596d8c09e0d7513a30fbe55dd (diff)
downloadguix-c7ed1e01600a5b37599ab50a30b2c41da646b1f4.tar
guix-c7ed1e01600a5b37599ab50a30b2c41da646b1f4.tar.gz
git-download: Honor the ‘GUIX_DOWNLOAD_FALLBACK_TEST’ environment variable.
* guix/git-download.scm (git-fetch): Honor ‘%download-fallback-test’.
Diffstat (limited to 'guix/git-download.scm')
-rw-r--r--guix/git-download.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/git-download.scm b/guix/git-download.scm
index 8989b1b463..f1f19397c6 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -28,6 +28,7 @@
#:use-module (guix packages)
#:use-module (guix modules)
#:autoload (guix build-system gnu) (standard-packages)
+ #:autoload (guix download) (%download-fallback-test)
#:autoload (git bindings) (libgit2-init!)
#:autoload (git repository) (repository-open
repository-close!
@@ -161,7 +162,11 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
;; downloads.
#:script-name "git-download"
#:env-vars
- `(("git url" . ,(git-reference-url ref))
+ `(("git url" . ,(match (%download-fallback-test)
+ ('content-addressed-mirrors
+ "https://example.org/does-not-exist")
+ (_
+ (git-reference-url ref))))
("git commit" . ,(git-reference-commit ref))
("git recursive?" . ,(object->string
(git-reference-recursive? ref))))