use of org.eclipse.jgit.lib.BatchRefUpdate in project gerrit by GerritCodeReview.
the class CommitRewriterTest method cleanUp.
@After
public void cleanUp() throws Exception {
BatchRefUpdate bru = repo.getRefDatabase().newBatchUpdate();
bru.setAllowNonFastForwards(true);
for (Ref ref : repo.getRefDatabase().getRefsByPrefix(RefNames.REFS_CHANGES)) {
Change.Id changeId = Change.Id.fromRef(ref.getName());
if (changeId == null || !ref.getName().equals(RefNames.changeMetaRef(changeId))) {
continue;
}
bru.addCommand(new ReceiveCommand(ref.getObjectId(), ObjectId.zeroId(), ref.getName()));
}
RefUpdateUtil.executeChecked(bru, repo);
}
Aggregations