From 82595c260e3ef14347746636688914ee85e23a76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Sch=C3=B6nburg?= Date: Thu, 27 Jan 2022 12:13:59 +0100 Subject: [PATCH] feat: continue after failed cherry-pick Resets the state after a failed cherry-pick so that one failed backport does not prevent the next backport. --- src/git.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/git.ts b/src/git.ts index 915e640..ea8e99e 100644 --- a/src/git.ts +++ b/src/git.ts @@ -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}` );