aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache
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/dircache
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/dircache')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
index 39a0cdac5f..c85e156352 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCachePathEditTest.java
@@ -215,6 +215,23 @@ public class DirCachePathEditTest {
}
@Test
+ public void testDuplicateFiles() throws Exception {
+ DirCache dc = DirCache.newInCore();
+ DirCacheEditor editor = dc.editor();
+ editor.add(new AddEdit("a"));
+ editor.add(new AddEdit("a"));
+
+ try {
+ editor.finish();
+ fail("Expected DirCacheNameConflictException to be thrown");
+ } catch (DirCacheNameConflictException e) {
+ assertEquals("a a", e.getMessage());
+ assertEquals("a", e.getPath1());
+ assertEquals("a", e.getPath2());
+ }
+ }
+
+ @Test
public void testFileOverlapsTree() throws Exception {
DirCache dc = DirCache.newInCore();
DirCacheEditor editor = dc.editor();