Skip to content

Commit 3f01efc

Browse files
committed
getCommitsRange(): fixed IndexOutOfBoundsException if amount of requested commits exceeds actual commits amount
1 parent a12711f commit 3f01efc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/scm4j/vcs/GitVCS.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ public List<VCSCommit> getCommitsRange(String branchName, String startFromCommit
683683
if (direction == WalkDirection.ASC) {
684684
Collections.reverse(res);
685685
}
686-
if (limit != 0) {
686+
if (limit > 0 && res.size() > limit) {
687687
res = res.subList(0, limit);
688688
}
689689

0 commit comments

Comments
 (0)