[bug#78030,1/2] guix: channels: Add symref support.
Commit Message
* guix/channels.scm (channel-reference): Add symref support.
Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62
---
guix/channels.scm | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
base-commit: b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902
@@ -250,7 +250,13 @@ (define (channel-reference channel)
"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)))
+ (cond
+ ((and (string? branch)
+ (string-prefix? "refs/"
+ branch))
+ `(symref . ,branch))
+ (#t `(branch . ,branch)))))
(commit `(tag-or-commit . ,(channel-commit channel)))))
(define sexp->channel-introduction