Fixes another off-by-one issue when diffing with caching

Refactored commands and blame annotations
This commit is contained in:
Eric Amodio
2016-09-26 00:55:54 -04:00
parent 23b2c679a9
commit d2d72f0d54
16 changed files with 519 additions and 455 deletions

View File

@@ -12,15 +12,15 @@ const UncommittedRegex = /^[0]+$/;
function gitCommand(cwd: string, ...args) {
return spawnPromise('git', args, { cwd: cwd })
.then(s => {
console.log('[GitLens]', 'git', ...args);
console.log('[GitLens]', 'git', ...args, cwd);
return s;
})
.catch(ex => {
const msg = ex && ex.toString();
if (msg && (msg.includes('is outside repository') || msg.includes('no such path'))) {
console.warn('[GitLens]', 'git', ...args, msg && msg.replace(/\r?\n|\r/g, ' '));
console.warn('[GitLens]', 'git', ...args, cwd, msg && msg.replace(/\r?\n|\r/g, ' '));
} else {
console.error('[GitLens]', 'git', ...args, msg && msg.replace(/\r?\n|\r/g, ' '));
console.error('[GitLens]', 'git', ...args, cwd, msg && msg.replace(/\r?\n|\r/g, ' '));
}
throw ex;
});