Browse Source

Revert "Stop PathFilter after walking all matching paths"

This reverts commit 75eb6a147f.
Applications that want a PathFilter to abort the walk early should be
using PathFilterGroup. When a PathFilterGroup is created with exactly
one path its implementation is the same that 75eb6 tried to perform,
but has been long documented as having the behavior of breaking a
higher level OR filter graph node.

Change-Id: I6c85d75c474784471c32e866eef3402b9f193c08
stable-2.3
Shawn Pearce 12 years ago committed by Gerrit Code Review @ Eclipse.org
parent
commit
0b6387fe7c
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java

6
org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilter.java

@ -44,7 +44,6 @@
package org.eclipse.jgit.treewalk.filter;
import org.eclipse.jgit.errors.StopWalkException;
import org.eclipse.jgit.internal.JGitText;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.treewalk.TreeWalk;
@ -98,10 +97,7 @@ public class PathFilter extends TreeFilter {
@Override
public boolean include(final TreeWalk walker) {
int cmp = walker.isPathPrefix(pathRaw, pathRaw.length);
if (cmp > 0)
throw StopWalkException.INSTANCE;
return cmp == 0;
return walker.isPathPrefix(pathRaw, pathRaw.length) == 0;
}
@Override

Loading…
Cancel
Save