mirror of
https://code.forgejo.org/actions/git-backporting
synced 2025-03-15 14:44:39 +01:00
fix: return GitHub no-squash commits in order (#115)
Fixes: https://github.com/kiegroup/git-backporting/issues/114
This commit is contained in:
parent
fe6be83074
commit
6d9b9db590
5 changed files with 6 additions and 6 deletions
2
dist/cli/index.js
vendored
2
dist/cli/index.js
vendored
|
@ -1469,7 +1469,7 @@ class Runner {
|
||||||
}
|
}
|
||||||
// 7. apply all changes to the new branch
|
// 7. apply all changes to the new branch
|
||||||
this.logger.debug("Cherry picking commits..");
|
this.logger.debug("Cherry picking commits..");
|
||||||
for (const sha of originalPR.commits) {
|
for (const sha of originalPR.commits.reverse()) {
|
||||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||||
}
|
}
|
||||||
if (!configs.dryRun) {
|
if (!configs.dryRun) {
|
||||||
|
|
2
dist/gha/index.js
vendored
2
dist/gha/index.js
vendored
|
@ -1436,7 +1436,7 @@ class Runner {
|
||||||
}
|
}
|
||||||
// 7. apply all changes to the new branch
|
// 7. apply all changes to the new branch
|
||||||
this.logger.debug("Cherry picking commits..");
|
this.logger.debug("Cherry picking commits..");
|
||||||
for (const sha of originalPR.commits) {
|
for (const sha of originalPR.commits.reverse()) {
|
||||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||||
}
|
}
|
||||||
if (!configs.dryRun) {
|
if (!configs.dryRun) {
|
||||||
|
|
|
@ -146,7 +146,7 @@ export default class Runner {
|
||||||
|
|
||||||
// 7. apply all changes to the new branch
|
// 7. apply all changes to the new branch
|
||||||
this.logger.debug("Cherry picking commits..");
|
this.logger.debug("Cherry picking commits..");
|
||||||
for (const sha of originalPR.commits!) {
|
for (const sha of originalPR.commits.reverse()!) {
|
||||||
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
await git.gitCli.cherryPick(configs.folder, sha, configs.mergeStrategy, configs.mergeStrategyOption, configs.cherryPickOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -681,7 +681,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toHaveBeenLastCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
|
@ -787,7 +787,7 @@ describe("cli runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", "ort", "find-renames", undefined);
|
expect(GitCLIService.prototype.cherryPick).toHaveBeenLastCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", "ort", "find-renames", undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", "ort", "find-renames", undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", "ort", "find-renames", undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
|
|
|
@ -498,7 +498,7 @@ describe("gha runner", () => {
|
||||||
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
expect(GitCLIService.prototype.fetch).toBeCalledTimes(0);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledTimes(2);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toHaveBeenLastCalledWith(cwd, "0404fb922ab75c3a8aecad5c97d9af388df04695", undefined, undefined, undefined);
|
||||||
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined, undefined);
|
expect(GitCLIService.prototype.cherryPick).toBeCalledWith(cwd, "11da4e38aa3e577ffde6d546f1c52e53b04d3151", undefined, undefined, undefined);
|
||||||
|
|
||||||
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
expect(GitCLIService.prototype.push).toBeCalledTimes(1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue