I have this:
nodegit.Reference
.lookup(repo, `refs/tags/${tagName}`)
.then(ref => nodegit.Commit.lookup(repo, ref.target()))
.then(commit => ({
tag: tagName,
hash: commit.sha(),
date: commit.date().toJSON(),
}))
This code works if the tagName is just an alias to a commit but it gives me an error if the tag is a proper Tag created with nodegit:
the requested type does not match the type in the ODB
When using git show [tagname]
it shows this:
tag release_2017-07-21_1413
Tagger: xxx
Date: Fri Jul 21 16:13:47 2017 +0200
commit c465e3323fc2c63fbeb91f9b9b43379d28f9b761 (tag: release_2017-07-21_1413, initialRelease)
So how do I get from this tag reference to the commit itself (c465e) ?