assertEquals(2, db.getObjectDatabase().listPacks().size());
}
@Test
public void testReaderResolve() throws IOException {
ObjectInserter ins = db.newObjectInserter();
ObjectId id1 = ins.insert(Constants.OBJ_BLOB, Constants.encode("foo"));
ins.flush();
ObjectId id2 = ins.insert(Constants.OBJ_BLOB, Constants.encode("bar"));
String abbr1 = ObjectId.toString(id1).substring(0, 4);
String abbr2 = ObjectId.toString(id2).substring(0, 4);
assertFalse(abbr1.equals(abbr2));
ObjectReader reader = ins.newReader();
Collection<ObjectId> objs;
objs = reader.resolve(AbbreviatedObjectId.fromString(abbr1));
assertEquals(1, objs.size());
assertEquals(id1, objs.iterator().next());