git: better error handling

This commit is contained in:
Joao Moreno
2017-01-12 09:37:54 +01:00
parent 87eea6cdcc
commit c46b5c8a8b
4 changed files with 34 additions and 11 deletions

View File

@@ -331,7 +331,7 @@ export class Git {
}
if (options.log !== false) {
this.log(`ERROR: ${result.stderr}\n`);
this.log(`${result.stderr}\n`);
}
return Promise.reject<IExecutionResult>(new GitError({
@@ -363,7 +363,7 @@ export class Git {
options.env = _.assign({}, process.env, options.env || {});
if (options.log !== false) {
this.log(`SPAWN: git ${args.join(' ')}\n`);
this.log(`git ${args.join(' ')}\n`);
}
return cp.spawn(this.gitPath, args, options);