kevinsawicki / gitective

Find the Git commits you're looking for
http://gitective.org
117 stars 53 forks source link

TreeUtils.getId(Repository, revision, path) #2

Closed sonson closed 12 years ago

sonson commented 12 years ago

Hello,

first of all I want to say thank you for this great library. I am a (J)Git-beginner and didn't find any good JGit-examples until I found gitective. It really makes complicate things easier for me. :-)

One suggestion:

I have to list all files of a path. It would be very useful, if there is a TreeUtils.getId(Repository, String revision, String path)-method which returns an ObjectId. (I have found BlobUtils.getId(), but this only works for BLOB and not for TREEs.)

kevinsawicki commented 12 years ago

Thanks for the feedback, just pushed a new helper that returns the tree id for the given path and commit.

Will probably release a 0.9.5 over the weekend with this included.

sonson commented 12 years ago

Great, thank you very much!

kevinsawicki commented 12 years ago

This has been released in 0.9.6 which is available in Maven central.

Also added was TreeUtils.visit which allows you to visit each tree entry recursively and know the name, parent path, SHA-1, and mode of each entry being visited.