Search in sources :

Example 56 with ObjectInserter

use of org.eclipse.jgit.lib.ObjectInserter in project gerrit by GerritCodeReview.

the class TreeCreator method writeAndGetId.

private static ObjectId writeAndGetId(Repository repository, DirCache tree) throws IOException {
    try (ObjectInserter objectInserter = repository.newObjectInserter()) {
        ObjectId treeId = tree.writeTree(objectInserter);
        objectInserter.flush();
        return treeId;
    }
}
Also used : ObjectInserter(org.eclipse.jgit.lib.ObjectInserter) ObjectId(org.eclipse.jgit.lib.ObjectId)

Aggregations

ObjectInserter (org.eclipse.jgit.lib.ObjectInserter)56 ObjectId (org.eclipse.jgit.lib.ObjectId)39 RevWalk (org.eclipse.jgit.revwalk.RevWalk)30 Repository (org.eclipse.jgit.lib.Repository)26 IOException (java.io.IOException)17 ObjectReader (org.eclipse.jgit.lib.ObjectReader)16 RevCommit (org.eclipse.jgit.revwalk.RevCommit)16 Change (com.google.gerrit.reviewdb.client.Change)13 PersonIdent (org.eclipse.jgit.lib.PersonIdent)12 NoteMap (org.eclipse.jgit.notes.NoteMap)12 CommitBuilder (org.eclipse.jgit.lib.CommitBuilder)11 RefUpdate (org.eclipse.jgit.lib.RefUpdate)11 BatchUpdate (com.google.gerrit.server.update.BatchUpdate)10 OrmException (com.google.gwtorm.server.OrmException)8 ExternalId (com.google.gerrit.server.account.externalids.ExternalId)7 ResourceConflictException (com.google.gerrit.extensions.restapi.ResourceConflictException)6 Project (com.google.gerrit.reviewdb.client.Project)6 ChangeControl (com.google.gerrit.server.project.ChangeControl)6 DirCache (org.eclipse.jgit.dircache.DirCache)6 Ref (org.eclipse.jgit.lib.Ref)6