assertEquals(cmtid, c.getCommitId());
// Verify the commit we just wrote is in the correct format.
- final XInputStream xis = new XInputStream(new FileInputStream(db
- .toFile(cmtid)));
+ ObjectDatabase odb = db.getObjectDatabase();
+ assertTrue("is ObjectDirectory", odb instanceof ObjectDirectory);
+ final XInputStream xis = new XInputStream(new FileInputStream(
+ ((ObjectDirectory) odb).fileFor(cmtid)));
try {
assertEquals(0x78, xis.readUInt8());
assertEquals(0x9c, xis.readUInt8());
return repoConfig;
}
- /**
- * Construct a filename where the loose object having a specified SHA-1
- * should be stored. If the object is stored in a shared repository the path
- * to the alternative repo will be returned. If the object is not yet store
- * a usable path in this repo will be returned. It is assumed that callers
- * will look for objects in a pack first.
- *
- * @param objectId
- * @return suggested file name
- */
- public File toFile(final AnyObjectId objectId) {
- return objectDatabase.fileFor(objectId);
- }
-
/**
* Objects known to exist but not expressed by {@link #getAllRefs()}.
* <p>
return fs;
}
- /**
- * Construct a filename where the loose object having a specified SHA-1
- * should be stored. If the object is stored in a shared repository the path
- * to the alternative repo will be returned. If the object is not yet store
- * a usable path in this repo will be returned. It is assumed that callers
- * will look for objects in a pack first.
- *
- * @param objectId
- * @return suggested file name
- */
- public abstract File toFile(AnyObjectId objectId);
-
/**
* @param objectId
* @return true if the specified object is stored in this repo or any of the