summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit/src
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index e3eb2c5367..24f7741f16 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -44,7 +44,9 @@ import org.eclipse.jgit.internal.storage.file.FileRepository;
import org.eclipse.jgit.internal.storage.file.LockFile;
import org.eclipse.jgit.internal.storage.file.ObjectDirectory;
import org.eclipse.jgit.internal.storage.file.Pack;
+import org.eclipse.jgit.internal.storage.file.PackFile;
import org.eclipse.jgit.internal.storage.file.PackIndex.MutableEntry;
+import org.eclipse.jgit.internal.storage.pack.PackExt;
import org.eclipse.jgit.internal.storage.pack.PackWriter;
import org.eclipse.jgit.lib.AnyObjectId;
import org.eclipse.jgit.lib.Constants;
@@ -906,7 +908,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
ObjectDirectory odb = (ObjectDirectory) db.getObjectDatabase();
NullProgressMonitor m = NullProgressMonitor.INSTANCE;
- final File pack, idx;
+ final PackFile pack, idx;
try (PackWriter pw = new PackWriter(db)) {
Set<ObjectId> all = new HashSet<>();
for (Ref r : db.getRefDatabase().getRefs())
@@ -922,7 +924,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
}
pack.setReadOnly();
- idx = nameFor(odb, name, ".idx");
+ idx = pack.create(PackExt.INDEX);
try (OutputStream out =
new BufferedOutputStream(new FileOutputStream(idx))) {
pw.writeIndex(out);
@@ -960,9 +962,10 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
}
}
- private static File nameFor(ObjectDirectory odb, ObjectId name, String t) {
+ private static PackFile nameFor(ObjectDirectory odb, ObjectId name,
+ String t) {
File packdir = odb.getPackDirectory();
- return new File(packdir, "pack-" + name.name() + t);
+ return new PackFile(packdir, "pack-" + name.name() + t);
}
private void writeFile(File p, byte[] bin) throws IOException,