Skip to content

fix: Update exception handling logic for cases where HEAD has only a single commit

Checklist

Description

Context

This exception handler was meant to handle cases where a range of git commits were requested but nothing was found within the given range. For example, if --since 1.week.ago was requested but there weren't any commits within the last week. In this case, the exception handler was to return only the most recent commit on the default branch. However, there are repositories with only a single commit on the default branch, so selecting something like main-1..main would fail. The new check guarantees we will only get the most recent commit and works for the "single commit on default branch" case.

Intent

Fix the case where we run the exception handler but only have a single commit on the default branch.

Merge request reports

Loading