开发者

JGit: Count objects

开发者 https://www.devze.com 2023-04-08 02:43 出处:网络
How can I retrieve the total number of git objects in a repository? (I search something like the git count-objects in JGit.)

How can I retrieve the total number of git objects in a repository? (I search something like the git count-objects in JGit.)

I made a Java program that calculates statistic values and has to read every object (blob, tree, commit, tag) of a git repository. Something like a progress bar should show the user how many objects already have been processed. So I need th开发者_StackOverflow中文版e total number of git objects.


I did not manipulate the Git objects at all, but I suppose you should explore the Repository object, which has methods like getAllRefs() or getObjectDatabase().

From the results, I imagine you could find what you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号