assertTrue(filter.include(fakeWalk("d/e/f/g/h")));
}
+ @Test
+ public void testLongPaths() throws MissingObjectException,
+ IncorrectObjectTypeException, IOException {
+ TreeFilter longPathFilter = PathFilterGroup
+ .createFromStrings(
+ "tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java",
+ "tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest2.java");
+ assertFalse(longPathFilter
+ .include(fakeWalk("tst/org/eclipse/jgit/treewalk/FileTreeIteratorTest.java")));
+ assertFalse(longPathFilter.include(fakeWalk("tst/a-other-in-same")));
+ assertFalse(longPathFilter.include(fakeWalk("a-nothing-in-common")));
+ }
+
@Test
public void testStopWalk() throws MissingObjectException,
IncorrectObjectTypeException, IOException {
}
private static boolean equals(byte[] a, byte[] b, int length) {
- if (a.length < length || b.length < length)
+ if (a.length != length || b.length < length)
return false;
for (int i = 0; i < length; ++i) {
if (a[i] != b[i])