aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2010-05-08 17:16:26 -0400
committerCode Review <codereview-daemon@eclipse.org>2010-05-08 17:16:26 -0400
commit541ad72ac6a6529e20fb1b0694c592c0bcc98d38 (patch)
tree86924dba53581c2986bf380dc4bf8239f02b26d3 /org.eclipse.jgit.test
parent0df679aea175aaba322416e586535ac877eba9a8 (diff)
parentb9ab040b45f0a0329d76fc919b0111414fdaf035 (diff)
downloadjgit-541ad72ac6a6529e20fb1b0694c592c0bcc98d38.tar.gz
jgit-541ad72ac6a6529e20fb1b0694c592c0bcc98d38.zip
Merge "Added MERGING_RESOLVED repository state"
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
index b35fc76175..f4692b168d 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBasicTest.java
@@ -186,10 +186,30 @@ public class DirCacheBasicTest extends RepositoryTestCase {
for (int i = 0; i < ents.length; i++)
b.add(ents[i]);
b.finish();
+ assertFalse(dc.hasUnmergedPaths());
assertEquals(paths.length, dc.getEntryCount());
dc.clear();
assertEquals(0, dc.getEntryCount());
+ assertFalse(dc.hasUnmergedPaths());
+ }
+
+ public void testDetectUnmergedPaths() throws Exception {
+ final DirCache dc = DirCache.read(db);
+ final DirCacheEntry[] ents = new DirCacheEntry[3];
+
+ ents[0] = new DirCacheEntry("a", 1);
+ ents[0].setFileMode(FileMode.REGULAR_FILE);
+ ents[1] = new DirCacheEntry("a", 2);
+ ents[1].setFileMode(FileMode.REGULAR_FILE);
+ ents[2] = new DirCacheEntry("a", 3);
+ ents[2].setFileMode(FileMode.REGULAR_FILE);
+
+ final DirCacheBuilder b = dc.builder();
+ for (int i = 0; i < ents.length; i++)
+ b.add(ents[i]);
+ b.finish();
+ assertTrue(dc.hasUnmergedPaths());
}
public void testFindOnEmpty() throws Exception {