mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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
This commit is contained in:
parent
3cadb61963
commit
a57518484e
2 changed files with 26 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue