summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorChristian Halstrick <christian.halstrick@sap.com>2013-04-04 03:42:25 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2013-04-04 03:42:25 -0400
commit81b601de53125bbcd30620b58168154d7541d8ad (patch)
tree92b7fed2238522fc39c3492f4662300426b86d04 /org.eclipse.jgit
parentac0481039da211261248bfba1683f489dc341d92 (diff)
parentc9a94dc1eeabeda212ed0b2eab0afdd67331b848 (diff)
downloadjgit-81b601de53125bbcd30620b58168154d7541d8ad.tar.gz
jgit-81b601de53125bbcd30620b58168154d7541d8ad.zip
Merge "Fix PathFilterGroup not to throw StopWalkException too early"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java
index 66d9f87a77..bdfde0bfcd 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/treewalk/filter/PathFilterGroup.java
@@ -208,6 +208,19 @@ public class PathFilterGroup {
if (compare(max, pf.pathRaw) < 0)
max = pf.pathRaw;
}
+ // Adjust max for the git sort order. A path we compare
+ // with may end with a slash at any position (but the
+ // first, but we ignore that here since it's not relevant).
+ // Such paths must be included in the processing
+ // before we can give up and throw a StopWalkException.
+ byte[] newMax = new byte[max.length + 1];
+ for (int i = 0; i < max.length; ++i)
+ if ((max[i] & 0xFF) < '/')
+ newMax[i] = '/';
+ else
+ newMax[i] = max[i];
+ newMax[newMax.length - 1] = '/';
+ max = newMax;
}
private static int compare(byte[] a, byte[] b) {