Skip to content

Commit

Permalink
feat: continue after failed cherry-pick
Browse files Browse the repository at this point in the history
Resets the state after a failed cherry-pick so that one failed backport
does not prevent the next backport.
  • Loading branch information
lenaschoenburg committed Jan 27, 2022
1 parent f2c8506 commit 82595c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ async function checkout(branch: string, start: string, pwd: string) {
async function cherryPick(diffrefs: string[], pwd: string) {
const { exitCode } = await git("cherry-pick", ["-x", ...diffrefs], pwd);
if (exitCode !== 0) {
await git("cherry-pick", ["--abort"], pwd);
throw new Error(
`'git cherry-pick -x ${diffrefs}' failed with exit code ${exitCode}`
);
Expand Down

0 comments on commit 82595c2

Please sign in to comment.