#27 -- fix read commits

This commit is contained in:
Anton Romanov 2021-04-28 14:45:03 +04:00
parent fd15fd52df
commit 76c13d02f5

View File

@ -107,17 +107,13 @@ public class GitRepositoryService {
Git git = new Git(localRepo);
List<RevCommit> commits = new ArrayList<>();
git.log().call().forEach(commits::add);
git.log().setSkip(commitsFrom).setMaxCount(commitsTo - commitsFrom).call().forEach(commits::add);
List<Commit> list = new ArrayList<>();
RevCommit prevCommit = null;
LOG.debug("Start analyse {} commits", commits.size());
commitsFrom = Math.max(commitsFrom, 0);
commitsTo = Math.min(commitsTo, commits.size());
commitsTo = Math.max(commitsTo, 0);
for (int i = commitsFrom; i < commitsTo; i++) {
RevCommit revCommit = commits.get(i);
LOG.debug(" {} to {} commits", i, commitsTo);
LOG.debug(" {} to {} commits", commitsFrom, commitsTo);
for (RevCommit revCommit : commits) {
Commit commit = new Commit(
revCommit.getFullMessage(),
new Author(revCommit.getAuthorIdent().getName()),