( git: GitCommandManager, base: string, branch: string )
| 49 | } |
| 50 | |
| 51 | export async function buildBranchCommits( |
| 52 | git: GitCommandManager, |
| 53 | base: string, |
| 54 | branch: string |
| 55 | ): Promise<Commit[]> { |
| 56 | const output = await git.exec(['log', '--format=%H', `${base}..${branch}`]) |
| 57 | const shas = output.stdout |
| 58 | .split('\n') |
| 59 | .filter(x => x !== '') |
| 60 | .reverse() |
| 61 | const commits: Commit[] = [] |
| 62 | for (const sha of shas) { |
| 63 | const commit = await git.getCommit(sha) |
| 64 | commits.push(commit) |
| 65 | for (const unparsedChange of commit.unparsedChanges) { |
| 66 | core.warning(`Skipping unexpected diff entry: ${unparsedChange}`) |
| 67 | } |
| 68 | } |
| 69 | return commits |
| 70 | } |
| 71 | |
| 72 | // Return the number of commits that branch2 is ahead of branch1 |
| 73 | async function commitsAhead( |
no test coverage detected