backport
Version:
A CLI tool that automates the process of backporting commits
18 lines • 780 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMergeCommits = void 0;
const git_1 = require("../git");
const fetchCommitBySha_1 = require("../github/v4/fetchCommits/fetchCommitBySha");
async function getMergeCommits(options, commit) {
const { sha } = commit.sourceCommit;
if (!options.mainline) {
const isMergeCommit = await (0, git_1.getIsMergeCommit)(options, sha);
if (isMergeCommit) {
const shas = await (0, git_1.getShasInMergeCommit)(options, sha);
return Promise.all(shas.reverse().map((sha) => (0, fetchCommitBySha_1.fetchCommitBySha)({ ...options, sha })));
}
}
return [commit];
}
exports.getMergeCommits = getMergeCommits;
//# sourceMappingURL=getMergeCommit.js.map