summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorRobin Stocker <robin@nibor.org>2013-02-19 23:41:15 +0100
committerRobin Rosenberg <robin.rosenberg@dewire.com>2013-02-20 00:37:57 +0100
commit5d7b722f6e20232a5e03d76f10c5c9554ab754a9 (patch)
tree653298d6aee06126afe545bc0b32ec2d344fa19d /org.eclipse.jgit.test
parent9a5f4b46ccac22dd3dec8205ab50ec84f495db2f (diff)
downloadjgit-5d7b722f6e20232a5e03d76f10c5c9554ab754a9.tar.gz
jgit-5d7b722f6e20232a5e03d76f10c5c9554ab754a9.zip
Fix false positives in hashing used by PathFilterGroup
The ByteArraySet failed to check the length of the entry correctly leading to matches where no match should be. Bug: 401249 Change-Id: I925bc48d9cafcdf13e1a797bb09fc2555eb270c5 Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java
index 5267e81a15..8038206e9b 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathFilterGroupTest.java
@@ -135,6 +135,19 @@ public class PathFilterGroupTest {
}
@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 {
// Obvious