backport
Version:
A CLI tool that automates the process of backporting commits
14 lines • 636 B
JavaScript
import { getIsMergeCommit, getShasInMergeCommit } from '../git/index.js';
import { fetchCommitBySha } from '../github/v4/fetchCommits/fetch-commit-by-sha.js';
export async function getMergeCommits(options, commit) {
const { sha } = commit.sourceCommit;
if (!options.mainline) {
const isMergeCommit = await getIsMergeCommit(options, sha);
if (isMergeCommit) {
const shas = await getShasInMergeCommit(options, sha);
return Promise.all(shas.toReversed().map((sha) => fetchCommitBySha({ ...options, sha })));
}
}
return [commit];
}
//# sourceMappingURL=get-merge-commit.js.map