diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-06-30 10:39:00 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-06-30 10:39:00 -0700 |
commit | a1d5f5b6b526d086a0963c634a38edb6789a4594 (patch) | |
tree | 62f35a8ae5f7056ddcffc036865205e8bc3b54f1 /org.eclipse.jgit.test/tst | |
parent | cb9d8285bacf315e323d41f7bdc42acc8124fe98 (diff) | |
download | jgit-a1d5f5b6b526d086a0963c634a38edb6789a4594.tar.gz jgit-a1d5f5b6b526d086a0963c634a38edb6789a4594.zip |
Move DirCache factory methods to Repository
Instead of creating the DirCache from a static factory method, use
an instance method on Repository, permitting the implementation to
override the method with a completely different type of DirCache
reading and writing. This would better support a repository in the
cloud strategy, or even just an in-memory unit test environment.
Change-Id: I6399894b12d6480c4b3ac84d10775dfd1b8d13e7
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
12 files changed, 77 insertions, 77 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 f4692b168d..c3ac952a11 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 @@ -54,7 +54,7 @@ public class DirCacheBasicTest extends RepositoryTestCase { final File idx = new File(db.getDirectory(), "index"); assertFalse(idx.exists()); - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertNotNull(dc); assertEquals(0, dc.getEntryCount()); } @@ -74,7 +74,7 @@ public class DirCacheBasicTest extends RepositoryTestCase { assertFalse(idx.exists()); assertFalse(lck.exists()); - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); assertNotNull(dc); assertFalse(idx.exists()); assertTrue(lck.exists()); @@ -108,7 +108,7 @@ public class DirCacheBasicTest extends RepositoryTestCase { assertFalse(idx.exists()); assertFalse(lck.exists()); - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); assertEquals(0, lck.length()); dc.write(); assertEquals(12 + 20, lck.length()); @@ -124,7 +124,7 @@ public class DirCacheBasicTest extends RepositoryTestCase { assertFalse(idx.exists()); assertFalse(lck.exists()); - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); assertEquals(0, lck.length()); dc.write(); assertEquals(12 + 20, lck.length()); @@ -141,13 +141,13 @@ public class DirCacheBasicTest extends RepositoryTestCase { assertFalse(idx.exists()); assertFalse(lck.exists()); { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); dc.write(); assertTrue(dc.commit()); assertTrue(idx.exists()); } { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertEquals(0, dc.getEntryCount()); } } @@ -158,13 +158,13 @@ public class DirCacheBasicTest extends RepositoryTestCase { assertFalse(idx.exists()); assertFalse(lck.exists()); { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); dc.write(); assertTrue(dc.commit()); assertTrue(idx.exists()); } { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); assertEquals(0, dc.getEntryCount()); assertTrue(idx.exists()); assertTrue(lck.exists()); @@ -173,7 +173,7 @@ public class DirCacheBasicTest extends RepositoryTestCase { } public void testBuildThenClear() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a.b", "a/b", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -195,7 +195,7 @@ public class DirCacheBasicTest extends RepositoryTestCase { } public void testDetectUnmergedPaths() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final DirCacheEntry[] ents = new DirCacheEntry[3]; ents[0] = new DirCacheEntry("a", 1); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java index 03bb7f5e83..a09f8e86c4 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderIteratorTest.java @@ -52,7 +52,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup; public class DirCacheBuilderIteratorTest extends RepositoryTestCase { public void testPathFilterGroup_DoesNotSkipTail() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final FileMode mode = FileMode.REGULAR_FILE; final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" }; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java index e919e41f4d..81ffab9148 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheBuilderTest.java @@ -52,7 +52,7 @@ import org.eclipse.jgit.lib.RepositoryTestCase; public class DirCacheBuilderTest extends RepositoryTestCase { public void testBuildEmpty() throws Exception { { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); final DirCacheBuilder b = dc.builder(); assertNotNull(b); b.finish(); @@ -60,7 +60,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { assertTrue(dc.commit()); } { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertEquals(0, dc.getEntryCount()); } } @@ -86,7 +86,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { final int length = 1342; final DirCacheEntry entOrig; { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); final DirCacheBuilder b = dc.builder(); assertNotNull(b); @@ -113,7 +113,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { assertTrue(dc.commit()); } { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertEquals(1, dc.getEntryCount()); final DirCacheEntry entRead = dc.getEntry(0); @@ -135,7 +135,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { final int length = 1342; final DirCacheEntry entOrig; { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); final DirCacheBuilder b = dc.builder(); assertNotNull(b); @@ -160,7 +160,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { assertFalse(new File(db.getDirectory(), "index.lock").exists()); } { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertEquals(1, dc.getEntryCount()); final DirCacheEntry entRead = dc.getEntry(0); @@ -177,7 +177,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { public void testFindSingleFile() throws Exception { final String path = "a-file-path"; - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final DirCacheBuilder b = dc.builder(); assertNotNull(b); @@ -202,7 +202,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { } public void testAdd_InGitSortOrder() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a.b", "a/b", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -226,7 +226,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { } public void testAdd_ReverseGitSortOrder() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a.b", "a/b", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -250,7 +250,7 @@ public class DirCacheBuilderTest extends RepositoryTestCase { } public void testBuilderClear() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a.b", "a/b", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java index d5a632c48c..5533fe358a 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheFindTest.java @@ -48,7 +48,7 @@ import org.eclipse.jgit.lib.RepositoryTestCase; public class DirCacheFindTest extends RepositoryTestCase { public void testEntriesWithin() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java index efea117388..24e3c34ddf 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheIteratorTest.java @@ -52,7 +52,7 @@ import org.eclipse.jgit.treewalk.filter.PathFilterGroup; public class DirCacheIteratorTest extends RepositoryTestCase { public void testEmptyTree_NoTreeWalk() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertEquals(0, dc.getEntryCount()); final DirCacheIterator i = new DirCacheIterator(dc); @@ -60,7 +60,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testEmptyTree_WithTreeWalk() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertEquals(0, dc.getEntryCount()); final TreeWalk tw = new TreeWalk(db); @@ -70,7 +70,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testNoSubtree_NoTreeWalk() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -95,7 +95,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testNoSubtree_WithTreeWalk() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a0b" }; final FileMode[] modes = { FileMode.EXECUTABLE_FILE, FileMode.GITLINK }; @@ -128,7 +128,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testSingleSubtree_NoRecursion() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -172,7 +172,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testSingleSubtree_Recursive() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final FileMode mode = FileMode.REGULAR_FILE; final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" }; @@ -207,7 +207,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testTwoLevelSubtree_Recursive() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final FileMode mode = FileMode.REGULAR_FILE; final String[] paths = { "a.", "a/b", "a/c/e", "a/c/f", "a/d", "a0b" }; @@ -241,7 +241,7 @@ public class DirCacheIteratorTest extends RepositoryTestCase { } public void testTwoLevelSubtree_FilterPath() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final FileMode mode = FileMode.REGULAR_FILE; final String[] paths = { "a.", "a/b", "a/c/e", "a/c/f", "a/d", "a0b" }; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java index 0926ab9899..a6d7e39eb5 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheLargePathTest.java @@ -85,7 +85,7 @@ public class DirCacheLargePathTest extends RepositoryTestCase { assertEquals(shortPath, shortEnt.getPathString()); { - final DirCache dc1 = DirCache.lock(db); + final DirCache dc1 = db.lockDirCache(); { final DirCacheBuilder b = dc1.builder(); b.add(longEnt); @@ -97,7 +97,7 @@ public class DirCacheLargePathTest extends RepositoryTestCase { assertSame(shortEnt, dc1.getEntry(1)); } { - final DirCache dc2 = DirCache.read(db); + final DirCache dc2 = db.readDirCache(); assertEquals(2, dc2.getEntryCount()); assertNotSame(longEnt, dc2.getEntry(0)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java index 8345c5d83d..dfca2fb298 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/dircache/DirCacheTreeTest.java @@ -51,12 +51,12 @@ import org.eclipse.jgit.lib.RepositoryTestCase; public class DirCacheTreeTest extends RepositoryTestCase { public void testEmptyCache_NoCacheTree() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); assertNull(dc.getCacheTree(false)); } public void testEmptyCache_CreateEmptyCacheTree() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final DirCacheTree tree = dc.getCacheTree(true); assertNotNull(tree); assertSame(tree, dc.getCacheTree(false)); @@ -69,7 +69,7 @@ public class DirCacheTreeTest extends RepositoryTestCase { } public void testEmptyCache_Clear_NoCacheTree() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final DirCacheTree tree = dc.getCacheTree(true); assertNotNull(tree); dc.clear(); @@ -78,7 +78,7 @@ public class DirCacheTreeTest extends RepositoryTestCase { } public void testSingleSubtree() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a/b", "a/c", "a/d", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -115,7 +115,7 @@ public class DirCacheTreeTest extends RepositoryTestCase { } public void testTwoLevelSubtree() throws Exception { - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final String[] paths = { "a.", "a/b", "a/c/e", "a/c/f", "a/d", "a0b" }; final DirCacheEntry[] ents = new DirCacheEntry[paths.length]; @@ -172,7 +172,7 @@ public class DirCacheTreeTest extends RepositoryTestCase { * @throws IOException */ public void testWriteReadTree() throws CorruptObjectException, IOException { - final DirCache dc = DirCache.lock(db); + final DirCache dc = db.lockDirCache(); final String A = String.format("a%2000s", "a"); final String B = String.format("b%2000s", "b"); @@ -188,7 +188,7 @@ public class DirCacheTreeTest extends RepositoryTestCase { b.add(ents[i]); b.commit(); - DirCache read = DirCache.read(db); + DirCache read = db.readDirCache(); assertEquals(paths.length, read.getEntryCount()); assertEquals(1, read.getCacheTree(true).getChildCount()); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java index 1b4a11db50..1cd1261636 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/CherryPickTest.java @@ -67,10 +67,10 @@ public class CherryPickTest extends RepositoryTestCase { // Cherry-pick "T" onto "O". This shouldn't introduce "p-fail", which // was created by "P", nor should it modify "a", which was done by "P". // - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeP = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeP = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java index a4ef2cd643..8657c52b16 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/merge/SimpleMergeTest.java @@ -105,9 +105,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_validSubtreeSort() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); @@ -157,9 +157,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_concurrentSubtreeChange() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); @@ -204,9 +204,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_conflictSubtreeChange() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); @@ -237,9 +237,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_leftDFconflict1() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); @@ -269,9 +269,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_rightDFconflict1() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); @@ -301,9 +301,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_leftDFconflict2() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); @@ -331,9 +331,9 @@ public class SimpleMergeTest extends SampleDataRepositoryTestCase { } public void testTrivialTwoWay_rightDFconflict2() throws Exception { - final DirCache treeB = DirCache.read(db); - final DirCache treeO = DirCache.read(db); - final DirCache treeT = DirCache.read(db); + final DirCache treeB = db.readDirCache(); + final DirCache treeO = db.readDirCache(); + final DirCache treeT = db.readDirCache(); { final DirCacheBuilder b = treeB.builder(); final DirCacheBuilder o = treeO.builder(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/NameConflictTreeWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/NameConflictTreeWalkTest.java index 35298b803f..675331baf4 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/NameConflictTreeWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/NameConflictTreeWalkTest.java @@ -66,8 +66,8 @@ public class NameConflictTreeWalkTest extends RepositoryTestCase { private static final FileMode EXECUTABLE_FILE = FileMode.EXECUTABLE_FILE; public void testNoDF_NoGap() throws Exception { - final DirCache tree0 = DirCache.read(db); - final DirCache tree1 = DirCache.read(db); + final DirCache tree0 = db.readDirCache(); + final DirCache tree1 = db.readDirCache(); { final DirCacheBuilder b0 = tree0.builder(); final DirCacheBuilder b1 = tree1.builder(); @@ -97,8 +97,8 @@ public class NameConflictTreeWalkTest extends RepositoryTestCase { } public void testDF_NoGap() throws Exception { - final DirCache tree0 = DirCache.read(db); - final DirCache tree1 = DirCache.read(db); + final DirCache tree0 = db.readDirCache(); + final DirCache tree1 = db.readDirCache(); { final DirCacheBuilder b0 = tree0.builder(); final DirCacheBuilder b1 = tree1.builder(); @@ -128,8 +128,8 @@ public class NameConflictTreeWalkTest extends RepositoryTestCase { } public void testDF_GapByOne() throws Exception { - final DirCache tree0 = DirCache.read(db); - final DirCache tree1 = DirCache.read(db); + final DirCache tree0 = db.readDirCache(); + final DirCache tree1 = db.readDirCache(); { final DirCacheBuilder b0 = tree0.builder(); final DirCacheBuilder b1 = tree1.builder(); @@ -160,8 +160,8 @@ public class NameConflictTreeWalkTest extends RepositoryTestCase { } public void testDF_SkipsSeenSubtree() throws Exception { - final DirCache tree0 = DirCache.read(db); - final DirCache tree1 = DirCache.read(db); + final DirCache tree0 = db.readDirCache(); + final DirCache tree1 = db.readDirCache(); { final DirCacheBuilder b0 = tree0.builder(); final DirCacheBuilder b1 = tree1.builder(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java index d136b8f297..274df5bec0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/PostOrderTreeWalkTest.java @@ -86,7 +86,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { } public void testNoPostOrder() throws Exception { - final DirCache tree = DirCache.read(db); + final DirCache tree = db.readDirCache(); { final DirCacheBuilder b = tree.builder(); @@ -115,7 +115,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { } public void testWithPostOrder_EnterSubtree() throws Exception { - final DirCache tree = DirCache.read(db); + final DirCache tree = db.readDirCache(); { final DirCacheBuilder b = tree.builder(); @@ -150,7 +150,7 @@ public class PostOrderTreeWalkTest extends RepositoryTestCase { } public void testWithPostOrder_NoEnterSubtree() throws Exception { - final DirCache tree = DirCache.read(db); + final DirCache tree = db.readDirCache(); { final DirCacheBuilder b = tree.builder(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTestCase.java index ad51ac2ddf..302eada999 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/treewalk/filter/PathSuffixFilterTestCase.java @@ -64,7 +64,7 @@ public class PathSuffixFilterTestCase extends RepositoryTestCase { final ObjectInserter odi = db.newObjectInserter(); final ObjectId aSth = odi.insert(OBJ_BLOB, "a.sth".getBytes()); final ObjectId aTxt = odi.insert(OBJ_BLOB, "a.txt".getBytes()); - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final DirCacheBuilder builder = dc.builder(); final DirCacheEntry aSthEntry = new DirCacheEntry("a.sth"); aSthEntry.setFileMode(FileMode.REGULAR_FILE); @@ -100,7 +100,7 @@ public class PathSuffixFilterTestCase extends RepositoryTestCase { final ObjectId aTxt = odi.insert(OBJ_BLOB, "a.txt".getBytes()); final ObjectId bSth = odi.insert(OBJ_BLOB, "b.sth".getBytes()); final ObjectId bTxt = odi.insert(OBJ_BLOB, "b.txt".getBytes()); - final DirCache dc = DirCache.read(db); + final DirCache dc = db.readDirCache(); final DirCacheBuilder builder = dc.builder(); final DirCacheEntry aSthEntry = new DirCacheEntry("a.sth"); aSthEntry.setFileMode(FileMode.REGULAR_FILE); |