Skip to content

Commit

Permalink
dont display success msg if an error occurs during checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
grgzmy committed Nov 4, 2015
1 parent c7275a6 commit bbec5c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ module.exports = function gitBranchCheckout(exec, options) {
}

function onCheckout(branchName, err, stdout, stderr) {
validateExec(err, stdout, stderr);
result.emit('success', 'Switched to branch \'' + branchName.trim() + '\'');
if(!validateExec(err, stdout, stderr)){
result.emit('success', 'Switched to branch \'' + branchName.trim() + '\'');
}
}

exec(('git branch ' + options.join(' ')).trim(), onGitBranch);

return result;
};

0 comments on commit bbec5c8

Please sign in to comment.