ObjectInserter odi = repo.newObjectInserter();
try {
// Write the index as tree to the object database. This may
// fail for example when the index contains unmerged paths
// (unresolved conflicts)
ObjectId indexTreeId = index.writeTree(odi);
// Create a Commit object, populate it and write it
CommitBuilder commit = new CommitBuilder();
commit.setCommitter(committer);
commit.setAuthor(author);