diff options
author | Hector Caballero <hector.caballero@ericsson.com> | 2017-11-04 07:37:39 -0400 |
---|---|---|
committer | Hector Caballero <hector.caballero@ericsson.com> | 2017-11-14 10:08:42 -0500 |
commit | 4334b27d3cf4610b5c99bb29897cdfa785b06474 (patch) | |
tree | 3b8250d316e77d35686c9db8aa0f24a1f4402586 /org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage | |
parent | 178c5d2f0e94402638b521f6284a6c99149bf6b4 (diff) | |
download | jgit-4334b27d3cf4610b5c99bb29897cdfa785b06474.tar.gz jgit-4334b27d3cf4610b5c99bb29897cdfa785b06474.zip |
ObjectDirectory: Add pack directory getter
So far, in order to get the pack directory it was necessary to resolve
it from the object directory. This resolution is already done when
creating the object directory, so simplify the call by just adding a
getter to the pack directory.
Change-Id: I69e783141dc6739024e8b3d5acc30843edd651a7
Signed-off-by: Hector Caballero <hector.caballero@ericsson.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage')
5 files changed, 7 insertions, 7 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, |