mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-05-11 03:03:43 +00:00
fix(gh130): apply commits in the correct order on github (#131)
This commit is contained in:
parent
da6431b114
commit
cb3473d7c9
8 changed files with 3562 additions and 11 deletions
10
dist/cli/index.js
vendored
10
dist/cli/index.js
vendored
|
@ -1619,7 +1619,15 @@ class Runner {
|
|||
}
|
||||
// 7. apply all changes to the new branch
|
||||
this.logger.debug("Cherry picking commits..");
|
||||
for (const sha of originalPR.commits.reverse()) {
|
||||
// Commits might be ordered in different ways based on the git service, e.g., considering top to bottom
|
||||
// GITHUB --> oldest to newest
|
||||
// CODEBERG --> newest to oldest
|
||||
// GITLAB --> newest to oldest
|
||||
if (git.gitClientType === git_types_1.GitClientType.CODEBERG || git.gitClientType === git_types_1.GitClientType.GITLAB) {
|
||||
// reverse the order as we always need to process from older to newest
|
||||
originalPR.commits.reverse();
|
||||
}
|
||||
for (const sha of originalPR.commits) {
|
||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||
}
|
||||
if (!configs.dryRun) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue