Skip to content

Commit 516b9eb

Browse files
committed
add check for numCommits argument value
1 parent a96f032 commit 516b9eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/GitRepository.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ public History getHistory(File file, String sinceRevision, String tillRevision)
478478
public History getHistory(File file, String sinceRevision, String tillRevision,
479479
Integer numCommits) throws HistoryException {
480480

481+
if (numCommits != null && numCommits <= 0) {
482+
return null;
483+
}
484+
481485
HistoryCollector historyCollector = new HistoryCollector(isMergeCommitsEnabled());
482486
traverseHistory(file, sinceRevision, tillRevision, numCommits, List.of(historyCollector));
483487
History history = new History(historyCollector.entries, historyCollector.renamedFiles);

0 commit comments

Comments
 (0)