git: Don't try to resolve tags with 'tag-lookup'.

Fixes <https://bugs.gnu.org/40377>.
Reported by Brice Waegeneire <brice@waegenei.re>.

* guix/git.scm (switch-to-ref): In the 'tag case, remove call to
'tag-lookup'.
This commit is contained in:
Ludovic Courtès 2020-04-02 21:33:48 +02:00
parent 70c128dc33
commit efa578ecae
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 4 additions and 5 deletions

View File

@ -182,11 +182,10 @@ OID (roughly the commit hash) corresponding to REF."
(('tag . tag)
(let ((oid (reference-name->oid repository
(string-append "refs/tags/" tag))))
;; Get the commit that the tag at OID refers to. This is not
;; strictly needed, but it's more consistent to always return the
;; OID of a commit.
(object-lookup repository
(tag-target-id (tag-lookup repository oid))))))))
;; OID may point to a "tag" object, but it can also point directly
;; to a "commit" object, as surprising as it may seem. Return that
;; object, whatever that is.
(object-lookup repository oid))))))
(reset repository obj RESET_HARD)
(object-id obj))