Skip to content

Commit

Permalink
fix(travis-cli): read push commits directly
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed Nov 30, 2017
1 parent da23140 commit 9bc56c6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions @commitlint/travis-cli/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ async function main() {
const [start, end] = RANGE.split('.').filter(Boolean);
await lint(['--from', start, '--to', end]);
} else {
await lint(['--from', COMMIT]);
const input = await log(COMMIT);
await lint([], {input});
}
}

Expand All @@ -71,10 +72,21 @@ async function lint(args, options) {
return execa(
COMMITLINT || commitlint,
args,
Object.assign({}, {stdio: 'inherit'}, options)
Object.assign({}, {stdio: ['pipe', 'inherit', 'inherit']}, options)
);
}

async function log(hash) {
const result = await execa('git', [
'log',
'-n',
'1',
'--pretty=format:%B',
hash
]);
return result.stdout;
}

async function stash() {
if (await isClean()) {
return async () => {};
Expand Down

0 comments on commit 9bc56c6

Please sign in to comment.