mirror of
https://forgejo.stefka.eu/jiriks74/create-pull-request.git
synced 2025-01-18 16:01:06 +01:00
build branch commits
This commit is contained in:
parent
ec02db74e9
commit
b2a409b0a3
3 changed files with 104 additions and 2 deletions
16
dist/index.js
vendored
16
dist/index.js
vendored
|
@ -42,6 +42,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|||
exports.WorkingBaseType = void 0;
|
||||
exports.getWorkingBaseAndType = getWorkingBaseAndType;
|
||||
exports.tryFetch = tryFetch;
|
||||
exports.buildBranchCommits = buildBranchCommits;
|
||||
exports.buildBranchFileChanges = buildBranchFileChanges;
|
||||
exports.createOrUpdateBranch = createOrUpdateBranch;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
|
@ -83,6 +84,21 @@ function tryFetch(git, remote, branch, depth) {
|
|||
}
|
||||
});
|
||||
}
|
||||
function buildBranchCommits(git, base, branch) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const output = yield git.exec(['log', '--format=%H', `${base}..${branch}`]);
|
||||
const shas = output.stdout
|
||||
.split('\n')
|
||||
.filter(x => x !== '')
|
||||
.reverse();
|
||||
const commits = [];
|
||||
for (const sha of shas) {
|
||||
const commit = yield git.getCommit(sha);
|
||||
commits.push(commit);
|
||||
}
|
||||
return commits;
|
||||
});
|
||||
}
|
||||
function buildBranchFileChanges(git, base, branch) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const branchFileChanges = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue