Example usage for org.eclipse.jgit.lib RefDatabase newBatchUpdate

List of usage examples for org.eclipse.jgit.lib RefDatabase newBatchUpdate

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib RefDatabase newBatchUpdate.

Prototype

@NonNull
public BatchRefUpdate newBatchUpdate() 

Source Link

Document

Create a new batch update to attempt on this database.

Usage

From source file:com.google.gerrit.pgm.RebuildNotedb.java

License:Apache License

private void deleteDraftRefs(Repository allUsersRepo) throws IOException {
    RefDatabase refDb = allUsersRepo.getRefDatabase();
    Map<String, Ref> allRefs = refDb.getRefs(RefNames.REFS_DRAFT_COMMENTS);
    BatchRefUpdate bru = refDb.newBatchUpdate();
    for (Map.Entry<String, Ref> ref : allRefs.entrySet()) {
        bru.addCommand(new ReceiveCommand(ref.getValue().getObjectId(), ObjectId.zeroId(),
                RefNames.REFS_DRAFT_COMMENTS + ref.getKey()));
    }/*ww  w . j  a  v  a  2  s  . c o m*/
    execute(bru, allUsersRepo);
}