diff options
author | Shawn Pearce <spearce@spearce.org> | 2016-01-08 17:28:44 -0800 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2016-01-09 09:44:57 -0800 |
commit | 1243e25aadfb810bb39127473e80b3a5cb761883 (patch) | |
tree | d8d5acc74b0ce6bf49c46d97f460e2718440bf1a /org.eclipse.jgit.test/tst/org/eclipse/jgit/lib | |
parent | bace3835073b16a9d005d5baa88421071f433e4e (diff) | |
download | jgit-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.java | 16 |
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"); |