diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-11-14 20:37:26 -0500 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2017-11-14 20:37:26 -0500 |
commit | ef12214a7c50e7bf88397289d4c6a36f092349fc (patch) | |
tree | 219daf1e271f81404d0a82f72f7075357d2932d9 /org.eclipse.jgit.test | |
parent | 33b796869cf302f7100a2f3c5764a29eb56d9d3a (diff) | |
parent | 4334b27d3cf4610b5c99bb29897cdfa785b06474 (diff) | |
download | jgit-ef12214a7c50e7bf88397289d4c6a36f092349fc.tar.gz jgit-ef12214a7c50e7bf88397289d4c6a36f092349fc.zip |
Merge "ObjectDirectory: Add pack directory getter"
Diffstat (limited to 'org.eclipse.jgit.test')
6 files changed, 8 insertions, 9 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java index 343120ef5f..a9edf73b85 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/AbbreviationTest.java @@ -178,7 +178,7 @@ public class AbbreviationTest extends LocalDiskRepositoryTestCase { } String packName = "pack-" + id.name(); - File packDir = new File(db.getObjectDatabase().getDirectory(), "pack"); + File packDir = db.getObjectDatabase().getPackDirectory(); File idxFile = new File(packDir, packName + ".idx"); File packFile = new File(packDir, packName + ".pack"); FileUtils.mkdir(packDir, true); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java index 09438e9649..4813d28017 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ConcurrentRepackTest.java @@ -272,7 +272,7 @@ public class ConcurrentRepackTest extends RepositoryTestCase { } private File fullPackFileName(final ObjectId name, final String suffix) { - final File packdir = new File(db.getObjectDatabase().getDirectory(), "pack"); + final File packdir = db.getObjectDatabase().getPackDirectory(); return new File(packdir, "pack-" + name.name() + suffix); } diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java index 5393987781..79d72c56d0 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java @@ -71,7 +71,7 @@ public class GcOrphanFilesTest extends GcTestCase { @Before public void setUp() throws Exception { super.setUp(); - packDir = new File(repo.getObjectsDirectory(), PACK); + packDir = repo.getObjectDatabase().getPackDirectory(); } @Test diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java index f1cbb99d5a..cbb73bb08e 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/ObjectDirectoryTest.java @@ -129,8 +129,8 @@ public class ObjectDirectoryTest extends RepositoryTestCase { assertTrue(receivingDB.getObjectDatabase().hasPackedObject(id)); // preparations - File packsFolder = new File(receivingDB.getObjectsDirectory(), - "pack"); + File packsFolder = receivingDB.getObjectDatabase() + .getPackDirectory(); // prepare creation of a temporary file in the pack folder. This // simulates that a native git gc is happening starting to write // temporary files but has not yet finished diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java index 9b97eb4ff4..379432ddbb 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/PackWriterTest.java @@ -337,7 +337,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { */ @Test public void testWritePack2DeltasCRC32Copy() throws IOException { - final File packDir = new File(db.getObjectDatabase().getDirectory(), "pack"); + final File packDir = db.getObjectDatabase().getPackDirectory(); final File crc32Pack = new File(packDir, "pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.pack"); final File crc32Idx = new File(packDir, @@ -713,7 +713,7 @@ public class PackWriterTest extends SampleDataRepositoryTestCase { pw.preparePack(NullProgressMonitor.INSTANCE, ow, want, have, NONE); String id = pw.computeName().getName(); - File packdir = new File(repo.getObjectsDirectory(), "pack"); + File packdir = repo.getObjectDatabase().getPackDirectory(); File packFile = new File(packdir, "pack-" + id + ".pack"); FileOutputStream packOS = new FileOutputStream(packFile); pw.writePack(NullProgressMonitor.INSTANCE, diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/test/resources/SampleDataRepositoryTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/test/resources/SampleDataRepositoryTestCase.java index a57ef40b62..85a8aa7b8b 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/test/resources/SampleDataRepositoryTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/test/resources/SampleDataRepositoryTestCase.java @@ -79,8 +79,7 @@ public abstract class SampleDataRepositoryTestCase extends RepositoryTestCase { "pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa", "pack-3280af9c07ee18a87705ef50b0cc4cd20266cf12" }; - final File packDir = new File(repo.getObjectDatabase().getDirectory(), - "pack"); + final File packDir = repo.getObjectDatabase().getPackDirectory(); for (String n : packs) { JGitTestUtil.copyTestResource(n + ".pack", new File(packDir, n + ".pack")); JGitTestUtil.copyTestResource(n + ".idx", new File(packDir, n + ".idx")); |