Skip to content

Commit 0a14955

Browse files
committed
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.
1 parent 4bd6820 commit 0a14955

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: lib/prepare_release.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export default class ReleasePreparation extends Session {
9393
} = this;
9494

9595
// Create new proposal branch.
96-
cli.startSpinner(`Creating new proposal branch for ${newVersion}`);
96+
cli.startSpinner(`Switching to proposal branch for ${newVersion}`);
9797
const proposalBranch = await this.createProposalBranch(releaseBranch);
98-
cli.stopSpinner(`Created new proposal branch for ${newVersion}`);
98+
cli.stopSpinner(`Switched to proposal branch for ${newVersion}`);
9999

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

203203
// Create new proposal branch.
204-
cli.startSpinner(`Creating new proposal branch for ${newVersion}`);
204+
cli.startSpinner(`Switching to proposal branch for ${newVersion}`);
205205
await this.createProposalBranch();
206-
cli.stopSpinner(`Created new proposal branch for ${newVersion}`);
206+
cli.stopSpinner(`Switched to proposal branch for ${newVersion}`);
207207

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

536536
await runAsync('git', [
537537
'checkout',
538-
'-b',
538+
'-B',
539539
proposalBranch,
540540
base
541541
]);

0 commit comments

Comments
 (0)