Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Listing the contents of a directory.

Hi all,

I was able to navigate the folder by calling setRecursive(false) on
the treeWalk then checking for sub trees and entering them.

Since I had the objectId of the test folder, I didn't expect I'd have
to do this because the files were directly beneath it.

-Tim

On Apr 4, 2012, at 2:42 PM, Timothy Rodriguez
<timothy.rodriguez@xxxxxxxxx> wrote:

> Hi all,
>
> I've been trying to see a treeWalk instance to walk over a directory
> structure. I'm able to list commits, but when it comes to walking the
> file structure for a particular rev I've been having trouble.
>
> I've created in a simple repo with a test directory and 2 files
> underneath (test1.txt and test2.txt).
> I'm using TreeWalk.forPath() and I can read in a single file's
> contents however if the path is a directory (with 2 files under it) I
> cannot list the contents of the directory. When I fall treeWalk.next()
> it returns false as if there are no files contained in this directory.
>
> Is this the right way to list the contents of a directory for a
> particular revision?
>
> Thanks,
>
> Tim


Back to the top