]> source.dussan.org Git - jgit.git/commitdiff
Extend DirCache test case to check "intent to add" flag. 75/1475/1
authorMarc Strapetz <marc.strapetz@syntevo.com>
Tue, 31 Aug 2010 19:54:30 +0000 (21:54 +0200)
committerMarc Strapetz <marc.strapetz@syntevo.com>
Tue, 31 Aug 2010 19:57:10 +0000 (21:57 +0200)
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3 [new file with mode: 0644]
org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3.skipWorkTree [deleted file]
org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheCGitCompatabilityTest.java

diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3 b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3
new file mode 100644 (file)
index 0000000..4b8dacf
Binary files /dev/null and b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3 differ
diff --git a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3.skipWorkTree b/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3.skipWorkTree
deleted file mode 100644 (file)
index 4cbd703..0000000
Binary files a/org.eclipse.jgit.test/tst-rsrc/org/eclipse/jgit/test/resources/gitgit.index.v3.skipWorkTree and /dev/null differ
index f5cdfae2951509d0e2b398a270bc49c045ac5a40..a7e2bc823b6f9d0367a6cf3264d23807828cd82b 100644 (file)
@@ -183,11 +183,11 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase {
        }
 
        public void testReadWriteV3() throws Exception {
-               final File file = pathOf("gitgit.index.v3.skipWorkTree");
+               final File file = pathOf("gitgit.index.v3");
                final DirCache dc = new DirCache(file, FS.DETECTED);
                dc.read();
 
-               assertEquals(7, dc.getEntryCount());
+               assertEquals(10, dc.getEntryCount());
                assertV3TreeEntry(0, "dir1/file1.txt", false, false, dc);
                assertV3TreeEntry(1, "dir2/file2.txt", true, false, dc);
                assertV3TreeEntry(2, "dir3/file3.txt", false, false, dc);
@@ -195,6 +195,9 @@ public class DirCacheCGitCompatabilityTest extends LocalDiskRepositoryTestCase {
                assertV3TreeEntry(4, "dir4/file4.txt", true, false, dc);
                assertV3TreeEntry(5, "dir4/file4a.txt", false, false, dc);
                assertV3TreeEntry(6, "file.txt", true, false, dc);
+               assertV3TreeEntry(7, "newdir1/newfile1.txt", false, true, dc);
+               assertV3TreeEntry(8, "newdir1/newfile2.txt", false, true, dc);
+               assertV3TreeEntry(9, "newfile.txt", false, true, dc);
 
                final ByteArrayOutputStream bos = new ByteArrayOutputStream();
                dc.writeTo(bos);