ObjectInserter oi = db.newObjectInserter();
final ObjectId linkid = oi.insert(Constants.OBJ_BLOB, NORMALIZED_BYTES,
0, NORMALIZED_BYTES.length);
oi.release();
DirCache dc = db.lockDirCache();
DirCacheEditor dce = dc.editor();
dce.add(new DirCacheEditor.PathEdit("link") {
@Override
public void apply(DirCacheEntry ent) {
ent.setFileMode(FileMode.SYMLINK);
ent.setObjectId(linkid);