List of usage examples for org.eclipse.jgit.lib ObjectDatabase newReader
public abstract ObjectReader newReader();
From source file:jetbrains.buildServer.buildTriggers.vcs.git.commitInfo.GitCommitsInfoBuilder.java
License:Apache License
private void collect(@NotNull final Repository db, @NotNull final CommitsConsumer consumer, @NotNull final Map<String, String> currentStateWithTags, final boolean includeSubmodules) throws IOException { final ObjectDatabase cached = db.getObjectDatabase().newCachedDatabase(); final Map<String, Set<String>> index = getCommitToRefIndex(currentStateWithTags); final DotGitModulesResolver resolver = new CachedDotGitModulesResolver(new DotGitModulesResolverImpl(db)); final CommitTreeProcessor proc = new CommitTreeProcessor(resolver, db); final RevWalk walk = new RevWalk(cached.newReader()); try {/* w w w . j a v a 2 s. com*/ initWalk(walk, currentStateWithTags); RevCommit c; while ((c = walk.next()) != null) { final CommitDataBean commit = createCommit(c); includeRefs(index, commit); if (includeSubmodules) { includeSubModules(db, proc, c, commit); } consumer.consumeCommit(commit); } } finally { walk.dispose(); } }