diff options
author | Ludovic Courtès <ludo@gnu.org> | 2024-03-31 23:31:21 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-04-15 22:36:41 +0200 |
commit | 96d2de01853a5955ad882a565c903e1b1689b4f0 (patch) | |
tree | 914c0845a1f7a033bb1d04df5fbe8e4679b3158b /guix/channels.scm | |
parent | 088e181c0a58bf1a03e3aa7be1202fb3cd209136 (diff) | |
download | guix-96d2de01853a5955ad882a565c903e1b1689b4f0.tar guix-96d2de01853a5955ad882a565c903e1b1689b4f0.tar.gz |
git: Add ‘tag->commit’ and use it in (guix channels).
* guix/git.scm (tag->commit): New procedure, taken from…
(resolve-reference): … here. Use it in the ‘tag’ case.
* guix/channels.scm (resolve-channel-news-entry-tag): Use ‘tag->commit’
instead of custom code.
Change-Id: I46ea387345dc1b695ce0702991a52d0cde29e2f0
Diffstat (limited to 'guix/channels.scm')
-rw-r--r-- | guix/channels.scm | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/guix/channels.scm b/guix/channels.scm index 0b776ab211..70608561f9 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -26,6 +26,7 @@ commit-difference repository-info commit-short-id + tag->commit with-repository) #:autoload (guix git-authenticate) (authenticate-repository) #:autoload (guix openpgp) (openpgp-public-key-fingerprint @@ -1148,14 +1149,8 @@ the field its 'tag' refers to. A 'git-error' exception is raised if the tag cannot be found." (if (channel-news-entry-commit entry) entry - (let* ((tag (channel-news-entry-tag entry)) - (reference (reference-lookup repository - (string-append "refs/tags/" tag))) - (target (reference-target reference)) - (oid (let ((obj (object-lookup repository target))) - (if (= OBJ-TAG (object-type obj)) ;annotated tag? - (tag-target-id (tag-lookup repository target)) - target)))) + (let* ((tag (channel-news-entry-tag entry)) + (oid (object-id (tag->commit repository tag)))) (channel-news-entry (oid->string oid) tag (channel-news-entry-title entry) (channel-news-entry-body entry))))) |