Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] How to obtain number of files in repository?

On Sat, Jan 29, 2011 at 09:33, Dariusz Luksza <dariusz.luksza@xxxxxxxxx> wrote:
> How from jgit API can I _quickly_ obtain number of files in git repository?

- Number of files in a revision?
- Number of files in the working tree?

For either of these questions, use a TreeWalk, setRecursive(true), and
count the number of results.

- Number of files in the index?

Read the DirCache, I think it knows the count without enumerating
(because its allocated an array internally).

-- 
Shawn.


Back to the top