Skip to content

Commit c1aa8cb

Browse files
committed
use one git push command instead of two
1 parent 8aa8c08 commit c1aa8cb

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

lib/promote_release.js

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ export default class ReleasePromotion extends Session {
373373
let prompt = 'Merge proposal branch into staging branch?';
374374
if (dryRun) {
375375
cli.info('Run the following commands to merge the staging branch:');
376-
cli.info(`git push ${this.upstream} HEAD:refs/heads/${releaseBranch}`);
377-
cli.info(`git push ${this.upstream} HEAD:refs/heads/${stagingBranch}`);
376+
cli.info(`git push ${this.upstream} HEAD:refs/heads/${releaseBranch
377+
} HEAD:refs/heads/${stagingBranch}`);
378378
prompt = 'Ready to continue?';
379379
}
380380

@@ -388,12 +388,9 @@ export default class ReleasePromotion extends Session {
388388

389389
// TODO: find a solution for key passphrase from the terminal
390390
cli.startSpinner('Merging proposal branch');
391-
await Promise.all([
392-
forceRunAsync('git', ['push', this.upstream, `HEAD:refs/heads/${releaseBranch}`],
393-
{ ignoreFailure: false }),
394-
forceRunAsync('git', ['push', this.upstream, `HEAD:refs/heads/${stagingBranch}`],
395-
{ ignoreFailure: false })
396-
]);
391+
await forceRunAsync('git', ['push', this.upstream, `HEAD:refs/heads/${releaseBranch}`,
392+
`HEAD:refs/heads/${stagingBranch}`],
393+
{ ignoreFailure: false });
397394
cli.stopSpinner('Merged proposal branch');
398395
}
399396

@@ -404,8 +401,7 @@ export default class ReleasePromotion extends Session {
404401
let prompt = `Push release tag and ${this.branch} to ${this.upstream}?`;
405402
if (dryRun) {
406403
cli.info('Run the following commands to push to remote:');
407-
cli.info(`git push ${this.upstream} ${this.branch}`);
408-
cli.info(`git push ${this.upstream} ${tagVersion}`);
404+
cli.info(`git push ${this.upstream} ${this.branch} ${tagVersion}`);
409405
prompt = 'Ready to continue?';
410406
}
411407

@@ -418,10 +414,8 @@ export default class ReleasePromotion extends Session {
418414
}
419415

420416
cli.startSpinner('Pushing to remote');
421-
await Promise.all([
422-
forceRunAsync('git', ['push', this.upstream, this.branch], { ignoreFailure: false }),
423-
forceRunAsync('git', ['push', this.upstream, tagVersion], { ignoreFailure: false })
424-
]);
417+
await forceRunAsync('git', ['push', this.upstream, this.branch, tagVersion],
418+
{ ignoreFailure: false });
425419
cli.stopSpinner(`Pushed ${tagVersion} and ${this.branch} to remote`);
426420
}
427421

0 commit comments

Comments
 (0)