[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [egit-dev] Re: Finding the ObjectID of a subfolder in a repository
|
Brad Larson <bklarson@xxxxxxxxx> wrote:
> >
> >> mTreeWalk = new TreeWalk(mRepo);
> >> mRevWalk = new RevWalk(mRepo);
> >> mTreeWalk.addTree(new FileTreeIterator(aRootFolder));
> >> mTreeWalk.addTree(mRevWalk.parseTree(mRepo.resolve(Constants.HEAD)));
> >
> > mTreeWalk.setFilter(PathFilter.create("src/main/java"))
>
> I'd tried this earlier and it was returning no results... but it turns
> out I hadn't made the TreeWalker recursive. Setting it as recursive
> fixes that problem... but I'd prefer to not get results from the
> subdirs of my subdir. I think the only option is to give the
> TreeWalker trees with the root set to my subdir, and not use
> recursion. Any other options? Can I get a subdir tree from the
> repository?
If you don't want the recursive contents of src/main/java, yea,
you probably need to initialize the iterator from the subdirectory
rather than the top level.
--
Shawn.