Skip to content

Commit

Permalink
fix(push): 🐛fix check push, when remote branch not exists, output errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vivaxy committed Nov 28, 2016
1 parent cc0681e commit d116891
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions git/status/checkNeedPush.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@ import getRemote from './getRemote';

const hasCommitInShell = async(file, args) => {
let result = true;
const shellExec = await execa(file, args);
if (shellExec.code === 0) {
const splitResult = shellExec.stdout.split(`\n\r`);
const {code, stdout} = await execa(file, args);
if (code === 0) {
const splitResult = stdout.split(`\n\r`);
if (splitResult[0] === ``) {
result = false;
}
} else {
// fatal: ambiguous argument 'remote/sonar..sonar': unknown revision or path not in the working tree.
// Use '--' to separate paths from revisions, like this:
// 'git <command> [<revision>...] -- [<file>...]'
// remote branch not exits
result = true;
}
return result;
};
Expand Down

0 comments on commit d116891

Please sign in to comment.