aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib
diff options
context:
space:
mode:
authorShawn Pearce <spearce@spearce.org>2016-01-08 17:28:44 -0800
committerShawn Pearce <spearce@spearce.org>2016-01-09 09:44:57 -0800
commit1243e25aadfb810bb39127473e80b3a5cb761883 (patch)
treed8d5acc74b0ce6bf49c46d97f460e2718440bf1a /org.eclipse.jgit.test/tst/org/eclipse/jgit/lib
parentbace3835073b16a9d005d5baa88421071f433e4e (diff)
downloadjgit-1243e25aadfb810bb39127473e80b3a5cb761883.tar.gz
jgit-1243e25aadfb810bb39127473e80b3a5cb761883.zip
Paths.pathCompare: Utility to sort paths from byte[]
Consolidate copies of this function into one location. Add some unit tests to prevent bugs that were accidentally introduced while trying to make this refactoring. Change-Id: I82f64bbb8601ca2d8316ca57ae8119df32bb5c08
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/lib')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java
index 80230dccfa..43160fb115 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectCheckerTest.java
@@ -1327,7 +1327,8 @@ public class ObjectCheckerTest {
}
@Test
- public void testInvalidTreeDuplicateNames1() throws CorruptObjectException {
+ public void testInvalidTreeDuplicateNames1_File()
+ throws CorruptObjectException {
StringBuilder b = new StringBuilder();
entry(b, "100644 a");
entry(b, "100644 a");
@@ -1339,6 +1340,19 @@ public class ObjectCheckerTest {
}
@Test
+ public void testInvalidTreeDuplicateNames1_Tree()
+ throws CorruptObjectException {
+ StringBuilder b = new StringBuilder();
+ entry(b, "40000 a");
+ entry(b, "40000 a");
+ byte[] data = encodeASCII(b.toString());
+ assertCorrupt("duplicate entry names", OBJ_TREE, data);
+ assertSkipListAccepts(OBJ_TREE, data);
+ checker.setIgnore(DUPLICATE_ENTRIES, true);
+ checker.checkTree(data);
+ }
+
+ @Test
public void testInvalidTreeDuplicateNames2() throws CorruptObjectException {
StringBuilder b = new StringBuilder();
entry(b, "100644 a");