( from: string, to: string = 'HEAD', )
| 17 | * Find all commits within the given range and return an object describing those. |
| 18 | */ |
| 19 | export async function getCommitsInRange( |
| 20 | from: string, |
| 21 | to: string = 'HEAD', |
| 22 | ): Promise<CommitFromGitLog[]> { |
| 23 | gitClient ??= new GitClient(determineRepoBaseDirFromCwd()); |
| 24 | |
| 25 | const commits: CommitFromGitLog[] = []; |
| 26 | |
| 27 | for await (const commit of gitClient.getRawCommits({from, to, format: gitLogFormatForParsing})) { |
| 28 | commits.push(parseCommitFromGitLog(commit)); |
| 29 | } |
| 30 | |
| 31 | return commits; |
| 32 | } |
no test coverage detected