Skip to content

Commit aafb60d

Browse files
committed
switch to --oneCommitMax
1 parent 4c55189 commit aafb60d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

components/git/land.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ const landActions = {
4747
default: false,
4848
type: 'boolean'
4949
},
50-
allowMultipleCommits: {
51-
describe: 'Switch default answer if the pull request more than one commit',
50+
oneCommitMax: {
51+
describe: 'When run in conjunction with the --yes option, will abort the ' +
52+
'session if trying to land more than one commit',
5253
default: false,
5354
type: 'boolean'
5455
}

lib/landing_session.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ const LINT_RESULTS = {
2424
class LandingSession extends Session {
2525
constructor(cli, req, dir, {
2626
prid, backport, lint, autorebase, fixupAll,
27-
checkCI, allowMultipleCommits
27+
checkCI, oneCommitMax,
2828
} = {}) {
2929
super(cli, dir, prid);
3030
this.req = req;
3131
this.backport = backport;
3232
this.lint = lint;
3333
this.autorebase = autorebase;
3434
this.fixupAll = fixupAll;
35-
this.allowMultipleCommits = allowMultipleCommits;
35+
this.oneCommitMax = oneCommitMax;
3636
this.expectedCommitShas = [];
3737
this.checkCI = !!checkCI;
3838
}
@@ -43,7 +43,7 @@ class LandingSession extends Session {
4343
args.lint = this.lint;
4444
args.autorebase = this.autorebase;
4545
args.fixupAll = this.fixupAll;
46-
args.allowMultipleCommits = this.allowMultipleCommits;
46+
args.oneCommitMax = this.oneCommitMax;
4747
return args;
4848
}
4949

@@ -354,7 +354,7 @@ class LandingSession extends Session {
354354

355355
async final() {
356356
const {
357-
cli, owner, repo, upstream, branch, prid, allowMultipleCommits
357+
cli, owner, repo, upstream, branch, prid, oneCommitMax
358358
} = this;
359359

360360
// Check that git rebase/am has been completed.
@@ -370,7 +370,7 @@ class LandingSession extends Session {
370370
const forceLand = await cli.prompt(
371371
'There are more than one commit in the PR. ' +
372372
'Do you still want to land it?',
373-
{ defaultAnswer: allowMultipleCommits });
373+
{ defaultAnswer: !oneCommitMax });
374374

375375
if (!forceLand) {
376376
cli.info(

0 commit comments

Comments
 (0)