final DirCache treeB = db.readDirCache();
final DirCache treeO = db.readDirCache();
final DirCache treeP = db.readDirCache();
final DirCache treeT = db.readDirCache();
{
final DirCacheBuilder b = treeB.builder();
final DirCacheBuilder o = treeO.builder();
final DirCacheBuilder p = treeP.builder();
final DirCacheBuilder t = treeT.builder();
b.add(createEntry("a", FileMode.REGULAR_FILE));
o.add(createEntry("a", FileMode.REGULAR_FILE));
o.add(createEntry("o", FileMode.REGULAR_FILE));
p.add(createEntry("a", FileMode.REGULAR_FILE, "q"));
p.add(createEntry("p-fail", FileMode.REGULAR_FILE));
t.add(createEntry("a", FileMode.REGULAR_FILE));
t.add(createEntry("t", FileMode.REGULAR_FILE));
b.finish();
o.finish();
p.finish();
t.finish();
}
final ObjectInserter ow = db.newObjectInserter();
final ObjectId B = commit(ow, treeB, new ObjectId[] {});
final ObjectId O = commit(ow, treeO, new ObjectId[] { B });