src-d / go-git

Project has been moved to: https://github.com/go-git/go-git
https://github.com/go-git/go-git
Apache License 2.0
4.91k stars 542 forks source link

Get lightweight tags with func (*Repository) TagObject #1169

Closed MaxAst closed 5 years ago

MaxAst commented 5 years ago

Running:

ref, err := r.Head()
tag, _ := r.TagObject(ref.Hash())
fmt.Println(tag)

I'd like to get lightweight tags, not just annotated tags. Ideally, this would be done via options, similar to Clone etc.

mcuadros commented 5 years ago

Sorry as you can see the functions is retrieving Tag objects, not Tags in general, as a very different thing.

MaxAst commented 5 years ago

@mcuadros I get that, but I'm asking if it's possible for a Tag object to be a lightweight tag rather than just an annotated tag. In my example, I'd like to get the lightweight tag from my latest commit.