Skip to content
Advertisement

Why object from Git.tagList().call() is not a tag?


I’m trying Jgit and I want to retrieve all tags of a cloned repository and I want to sort them by Date. That’s why I’m trying the following:
JavaScript

The problem is that some of Ref returned by this.taglist = new Git(repository).tagList().call() are not Tag: in fact an exception is raised by parseTag() and its message is: org.eclipse.jgit.errors.IncorrectObjectTypeException: Object 3ea2b388b5ef02622312fe08e6935a5f9c655e00 is not a tag.

Can someone explain me why this happen and how can i solve the problem?
Thank you all.

Advertisement

Answer

As I said in the comment, i solved changing the walk.parseTag(o1.getObjectId()).getTaggerIdent().getWhen(); into walk.parseCommit(o1.getObjectId()).getAuthorIdent().getWhen(); and same for o2. Hope this will help others.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement