Subject: [bug#78030] [PATCH 1/2] guix: channels: Add symref support.

From: Romain GARBAGE <[email-masked]>
Date: Thu, 24 Apr 2025 10:19:58 +0200

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

Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62
---
 guix/channels.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index 4700f7a45d..72450da395 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -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

base-commit: b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902
-- 
2.49.0