aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain GARBAGE <romain.garbage@inria.fr>2025-04-24 10:19:59 +0200
committerLudovic Courtès <ludo@gnu.org>2025-04-25 20:25:28 +0200
commit7e90241586f0bde614df343c600f2b15e99b63fd (patch)
tree9d38279309ea044b6b41ecfec863fd6ac403dd3a
parentf3021149a825c1e9fe5e06ddfed87d5a44372f28 (diff)
downloadguix-7e90241586f0bde614df343c600f2b15e99b63fd.tar.gz
guix-7e90241586f0bde614df343c600f2b15e99b63fd.zip
git: Add support for symbolic references.
The #:refspecs argument was added in Guile-Git 0.10.0. * guix/git.scm (update-cached-checkout): Define ‘symref-list’. Pass it as #:refspecs to ‘remote-fetch’. Change-Id: Ib7874e2a30f97e51fdfdc2231a3bc5a3b45a177d Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/git.scm12
1 files changed, 10 insertions, 2 deletions
diff --git a/guix/git.scm b/guix/git.scm
index da0a668587..9975c9b92e 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -556,7 +556,7 @@ values: the cache directory name, and the SHA1 commit (a string) corresponding
to REF, and the relation of STARTING-COMMIT relative to the new commit (if
provided) as returned by 'commit-relation'.
-REF is pair whose key is [branch | commit | tag | tag-or-commit ] and value
+REF is pair whose key is [branch | commit | symref | tag | tag-or-commit ] and value
the associated data: [<branch name> | <sha1> | <tag name> | <string>].
If REF is the empty list, the remote HEAD is used.
@@ -592,6 +592,11 @@ current settings unchanged."
(string-append "origin/" branch))))
(_ ref)))
+ (define symref-list
+ (match ref
+ (('symref . symref) (list symref))
+ (_ '())))
+
(with-libgit2
(set-git-timeouts connection-timeout read-timeout)
(let* ((cache-exists? (openable-repository? cache-directory))
@@ -606,7 +611,10 @@ current settings unchanged."
(remote-fetch (remote-lookup repository "origin")
#:fetch-options (make-default-fetch-options
#:verify-certificate?
- verify-certificate?)))
+ verify-certificate?)
+ ;; Symbolic references are not fetched from the remote by
+ ;; default.
+ #:refspecs symref-list))
(when recursive?
(update-submodules repository #:log-port log-port
#:fetch-options