// Here we prepare the files with the info about the commits to apply in reverse
List<RevCommit> commitsToRevert = Lists.newArrayList();
Repository repository = repository();
for (ObjectId id : commits) {
Preconditions.checkArgument(repository.commitExists(id),
"Commit was not found in the repository: " + id.toString());
RevCommit commit = repository.getCommit(id);
commitsToRevert.add(commit);
}
createRevertCommitsInfoFiles(commitsToRevert);