Community
Participate
Working Groups
The code below only prints 'org.eclipse.jgit.console' when it should also print 'org.eclipse.jgit'. Repository repository = new FileRepository( new File(/* your jgit folder */)); TreeWalk walk = new TreeWalk(repository); TreeFilter filter = PathFilterGroup.createFromStrings( "org.eclipse.jgit", "org.eclipse.jgit.console"); walk.setFilter(filter); walk.addTree(new FileTreeIterator(repository)); while (walk.next()) { System.out.println(walk.getPathString()); }
In WorkingTreeIterator's list of entries, the org.eclipse.jgit entry comes after the org.eclipse.jgit.console entry. When PathFilterGroup.Group throws the StopWalkException for performance reason, we eagerly return and do not get a chance to check the filtering against the org.eclipse.jgit entry. Downgrading the severity as the workaround is to use PathFilter instead of PathFilterGroup for creating the filters.
The problem is that internally the sort order for org.eclipse.jgit and org.eclipse.jgit.console is different depending on whether they represent tree's or non-trees.
Doh. this one seems unfixed still
Posted https://git.eclipse.org/r/11597 for review
Merged some time ago