From 0a14955c39f36a24c62bb68b86e706cc8838df5b Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Mon, 6 Jan 2025 14:26:54 -0500 Subject: [PATCH] fix(git-node): prepare_release resilient checkout In `git node release --prepare` when checking out a new proposal branch make sure it's also possible to update an already existing branch of that same name instead of failing and terminating the automation. --- lib/prepare_release.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/prepare_release.js b/lib/prepare_release.js index c34a5e80..b5431a54 100644 --- a/lib/prepare_release.js +++ b/lib/prepare_release.js @@ -93,9 +93,9 @@ export default class ReleasePreparation extends Session { } = this; // Create new proposal branch. - cli.startSpinner(`Creating new proposal branch for ${newVersion}`); + cli.startSpinner(`Switching to proposal branch for ${newVersion}`); const proposalBranch = await this.createProposalBranch(releaseBranch); - cli.stopSpinner(`Created new proposal branch for ${newVersion}`); + cli.stopSpinner(`Switched to proposal branch for ${newVersion}`); const success = await this.cherryPickSecurityPRs(filterLabels); if (!success) { @@ -201,9 +201,9 @@ export default class ReleasePreparation extends Session { } // Create new proposal branch. - cli.startSpinner(`Creating new proposal branch for ${newVersion}`); + cli.startSpinner(`Switching to proposal branch for ${newVersion}`); await this.createProposalBranch(); - cli.stopSpinner(`Created new proposal branch for ${newVersion}`); + cli.stopSpinner(`Switched to proposal branch for ${newVersion}`); if (this.isLTSTransition) { // For releases transitioning into LTS, fetch the new code name. @@ -535,7 +535,7 @@ export default class ReleasePreparation extends Session { await runAsync('git', [ 'checkout', - '-b', + '-B', proposalBranch, base ]);