From f3021149a825c1e9fe5e06ddfed87d5a44372f28 Mon Sep 17 00:00:00 2001 From: Romain GARBAGE Date: Thu, 24 Apr 2025 10:19:58 +0200 Subject: [PATCH] channels: Add symref support. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/channels.scm (channel-reference): Add symref support. Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62 Signed-off-by: Ludovic Courtès Modified-by: Ludovic Courtès --- guix/channels.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/guix/channels.scm b/guix/channels.scm index 4700f7a45d0..7a02d24a846 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -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