Skip to content

Commit 5ac7927

Browse files
authored
fix(git-node): prepare_release resilient checkout (#882)
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.
1 parent cdf482f commit 5ac7927

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/prepare_release.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ export default class ReleasePreparation extends Session {
9292
} = this;
9393

9494
// Create new proposal branch.
95-
cli.startSpinner(`Creating new proposal branch for ${newVersion}`);
95+
cli.startSpinner(`Switching to proposal branch for ${newVersion}`);
9696
const proposalBranch = await this.createProposalBranch(releaseBranch);
97-
cli.stopSpinner(`Created new proposal branch for ${newVersion}`);
97+
cli.stopSpinner(`Switched to proposal branch for ${newVersion}`);
9898

9999
const success = await this.cherryPickSecurityPRs(filterLabels);
100100
if (!success) {
@@ -200,9 +200,9 @@ export default class ReleasePreparation extends Session {
200200
}
201201

202202
// Create new proposal branch.
203-
cli.startSpinner(`Creating new proposal branch for ${newVersion}`);
203+
cli.startSpinner(`Switching to proposal branch for ${newVersion}`);
204204
await this.createProposalBranch();
205-
cli.stopSpinner(`Created new proposal branch for ${newVersion}`);
205+
cli.stopSpinner(`Switched to proposal branch for ${newVersion}`);
206206

207207
if (this.isLTSTransition) {
208208
// For releases transitioning into LTS, fetch the new code name.
@@ -543,7 +543,7 @@ export default class ReleasePreparation extends Session {
543543

544544
await runAsync('git', [
545545
'checkout',
546-
'-b',
546+
'-B',
547547
proposalBranch,
548548
base
549549
]);

0 commit comments

Comments
 (0)