channels: Add symref support.

* guix/channels.scm (channel-reference): Add symref support.

Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Modified-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Romain GARBAGE 2025-04-24 10:19:58 +02:00 committed by Ludovic Courtès
parent 1a0f9a3689
commit f3021149a8
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -250,7 +250,11 @@ could be found at DIRECTORY or one of its ancestors."
"Return the \"reference\" for CHANNEL, an sexp suitable for
'latest-repository-commit'."
(match (channel-commit channel)
(#f `(branch . ,(channel-branch channel)))
(#f (let ((branch (channel-branch channel)))
(if (and (string? branch)
(string-prefix? "refs/" branch))
`(symref . ,branch)
`(branch . ,branch))))
(commit `(tag-or-commit . ,(channel-commit channel)))))
(define sexp->channel-introduction