Skip to content

Commit

Permalink
switch to --oneCommitMax
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Oct 23, 2021
1 parent 4c55189 commit aafb60d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions components/git/land.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ const landActions = {
default: false,
type: 'boolean'
},
allowMultipleCommits: {
describe: 'Switch default answer if the pull request more than one commit',
oneCommitMax: {
describe: 'When run in conjunction with the --yes option, will abort the ' +
'session if trying to land more than one commit',
default: false,
type: 'boolean'
}
Expand Down
10 changes: 5 additions & 5 deletions lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ const LINT_RESULTS = {
class LandingSession extends Session {
constructor(cli, req, dir, {
prid, backport, lint, autorebase, fixupAll,
checkCI, allowMultipleCommits
checkCI, oneCommitMax,
} = {}) {
super(cli, dir, prid);
this.req = req;
this.backport = backport;
this.lint = lint;
this.autorebase = autorebase;
this.fixupAll = fixupAll;
this.allowMultipleCommits = allowMultipleCommits;
this.oneCommitMax = oneCommitMax;
this.expectedCommitShas = [];
this.checkCI = !!checkCI;
}
Expand All @@ -43,7 +43,7 @@ class LandingSession extends Session {
args.lint = this.lint;
args.autorebase = this.autorebase;
args.fixupAll = this.fixupAll;
args.allowMultipleCommits = this.allowMultipleCommits;
args.oneCommitMax = this.oneCommitMax;
return args;
}

Expand Down Expand Up @@ -354,7 +354,7 @@ class LandingSession extends Session {

async final() {
const {
cli, owner, repo, upstream, branch, prid, allowMultipleCommits
cli, owner, repo, upstream, branch, prid, oneCommitMax
} = this;

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

if (!forceLand) {
cli.info(
Expand Down

0 comments on commit aafb60d

Please sign in to comment.