summaryrefslogtreecommitdiff
path: root/guix/channels.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2024-03-31 23:16:30 +0200
committerLudovic Courtès <ludo@gnu.org>2024-04-15 22:36:41 +0200
commita57518484e5437b29496e1c132c6566e1eb437e8 (patch)
treeb38925af1c45780127dbddf86e8b1ccaac9fe2af /guix/channels.scm
parent3cadb61963b2116d35a0f9b989223cf19155bec6 (diff)
git: Add ‘repository-info’ and use it in (guix channels).
* guix/git.scm (repository-info): New procedure. * guix/channels.scm (repository->guix-channel): Use it instead of local code. Change-Id: I74c758c73a22e16031571ca4271cc9cab0492f6e
Diffstat (limited to 'guix/channels.scm')
-rw-r--r--guix/channels.scm20
1 files changed, 8 insertions, 12 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 10f0e3800f..f26ccbc3ae 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -24,6 +24,7 @@
#:autoload (guix git) (update-cached-checkout
url+commit->name
commit-difference
+ repository-info
with-repository)
#:autoload (guix git-authenticate) (authenticate-repository)
#:autoload (guix openpgp) (openpgp-public-key-fingerprint
@@ -207,18 +208,13 @@ introduction, add it."
channel that uses that repository and the commit HEAD currently points to; use
INTRODUCTION as the channel's introduction. Return #f if no Git repository
could be found at DIRECTORY or one of its ancestors."
- (catch 'git-error
- (lambda ()
- (with-repository (repository-discover directory) repository
- (let* ((head (repository-head repository))
- (commit (oid->string (reference-target head))))
- (channel
- (inherit %default-guix-channel)
- (url (repository-working-directory repository))
- (commit commit)
- (branch (reference-shorthand head))
- (introduction introduction)))))
- (const #f)))
+ (let ((directory commit branch (repository-info directory)))
+ (channel
+ (inherit %default-guix-channel)
+ (url directory)
+ (commit commit)
+ (branch branch)
+ (introduction introduction))))
(define-record-type <channel-instance>
(channel-instance channel commit checkout)