Permalink
Browse files

Remove the Repository parameter from PackFile's constructor

This is a legacy parameter, from back when the WindowCache was
per-repository and not per-process.  We no longer need to pass
it down, so I'm ripping it out.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
  • Loading branch information...
1 parent 33e9506 commit a1f6d5d9ed9835f6f965434423c185519b5771a2 @spearce spearce committed with robinrosenberg Feb 12, 2009
View
2 org.spearce.jgit.test/tst/org/spearce/jgit/lib/PackWriterTest.java
@@ -471,7 +471,7 @@ private void verifyOpenPack(final boolean thin) throws IOException {
indexer.setKeepEmpty(true);
indexer.setFixThin(thin);
indexer.index(new TextProgressMonitor());
- pack = new PackFile(db, indexFile, packFile);
+ pack = new PackFile(indexFile, packFile);
}
private void verifyObjectsOrder(final ObjectId objectsOrder[]) {
View
2 org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0004_PackReader.java
@@ -54,7 +54,7 @@ public void test003_lookupCompressedObject() throws IOException {
final PackedObjectLoader or;
id = ObjectId.fromString("902d5476fa249b7abc9d84c611577a81381f0327");
- pr = new PackFile(db, TEST_IDX, TEST_PACK);
+ pr = new PackFile(TEST_IDX, TEST_PACK);
or = pr.get(new WindowCursor(), id);
assertNotNull(or);
assertEquals(Constants.OBJ_TREE, or.getType());
View
4 org.spearce.jgit.test/tst/org/spearce/jgit/transport/IndexPackTest.java
@@ -68,7 +68,7 @@ public void test1() throws IOException {
try {
IndexPack pack = new IndexPack(db, is, new File(trash, "tmp_pack1"));
pack.index(new TextProgressMonitor());
- PackFile file = new PackFile(db, new File(trash, "tmp_pack1.idx"), new File(trash, "tmp_pack1.pack"));
+ PackFile file = new PackFile(new File(trash, "tmp_pack1.idx"), new File(trash, "tmp_pack1.pack"));
assertTrue(file.hasObject(ObjectId.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904")));
assertTrue(file.hasObject(ObjectId.fromString("540a36d136cf413e4b064c2b0e0a4db60f77feab")));
assertTrue(file.hasObject(ObjectId.fromString("5b6e7c66c276e7610d4a73c70ec1a1f7c1003259")));
@@ -94,7 +94,7 @@ public void test2() throws IOException {
try {
IndexPack pack = new IndexPack(db, is, new File(trash, "tmp_pack2"));
pack.index(new TextProgressMonitor());
- PackFile file = new PackFile(db, new File(trash, "tmp_pack2.idx"), new File(trash, "tmp_pack2.pack"));
+ PackFile file = new PackFile(new File(trash, "tmp_pack2.idx"), new File(trash, "tmp_pack2.pack"));
assertTrue(file.hasObject(ObjectId.fromString("02ba32d3649e510002c21651936b7077aa75ffa9")));
assertTrue(file.hasObject(ObjectId.fromString("0966a434eb1a025db6b71485ab63a3bfbea520b6")));
assertTrue(file.hasObject(ObjectId.fromString("09efc7e59a839528ac7bda9fa020dc9101278680")));
View
5 org.spearce.jgit/src/org/spearce/jgit/lib/PackFile.java
@@ -65,17 +65,14 @@
/**
* Construct a reader for an existing, pre-indexed packfile.
*
- * @param parentRepo
- * Git repository holding this pack file
* @param idxFile
* path of the <code>.idx</code> file listing the contents.
* @param packFile
* path of the <code>.pack</code> file holding the data.
* @throws IOException
* the index file cannot be accessed at this time.
*/
- public PackFile(final Repository parentRepo, final File idxFile,
- final File packFile) throws IOException {
+ public PackFile(final File idxFile, final File packFile) throws IOException {
pack = new WindowedFile(packFile) {
@Override
protected void onOpen() throws IOException {
View
4 org.spearce.jgit/src/org/spearce/jgit/lib/Repository.java
@@ -800,7 +800,7 @@ public void openPack(final File pack, final File idx) throws IOException {
final PackFile[] cur = packFileList;
final PackFile[] arr = new PackFile[cur.length + 1];
System.arraycopy(cur, 0, arr, 1, cur.length);
- arr[0] = new PackFile(this, idx, pack);
+ arr[0] = new PackFile(idx, pack);
packFileList = arr;
}
}
@@ -849,7 +849,7 @@ public boolean accept(final File baseDir, final String n) {
}
try {
- packList.add(new PackFile(this, idxFile, packFile));
+ packList.add(new PackFile(idxFile, packFile));
} catch (IOException ioe) {
// Whoops. That's not a pack!
//

0 comments on commit a1f6d5d

Please sign in to comment.