[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] from SHA-1 hex string to RevCommit-object

You probably want to create a RevWalk and then call parseCommit():

http://download.eclipse.org/jgit/docs/jgit-2.0.0.201206130900-r/apidocs/org/eclipse/jgit/revwalk/RevWalk.html#parseCommit(org.eclipse.jgit.lib.AnyObjectId)

ObjectId has static factory methods to parse a string into an ObjectId instance, you can also try repository.resolve() if you want to handle branch names etc.

On 19 Jul 2012 22:35, "CG" <cg@xxxxxxxxx> wrote:
Now the other way around: given a SHA-1 in a hex String representing a
commit, question: produce the corresponding RevCommit object? Is there a
direct method for this purpose which can "eat" the given string wthout
further formatting?

TIA (Maria)


_______________________________________________
jgit-dev mailing list
jgit-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jgit-dev