Adds CodeLens for Diff'ing in blame

Other fixes and refactoring
This commit is contained in:
Eric Amodio
2016-08-31 21:15:06 -04:00
parent 0e064f15c7
commit 70cc92ddd6
9 changed files with 162 additions and 29 deletions

View File

@@ -18,9 +18,14 @@ export default class Git {
return gitCommand(cwd, 'rev-parse', '--show-toplevel').then(data => data.replace(/\r?\n|\r/g, ''));
}
static blame(fileName: string, repoPath: string) {
static blame(fileName: string, repoPath: string, sha?: string) {
fileName = Git.normalizePath(fileName, repoPath);
if (sha) {
console.log('git', 'blame', '-fnw', '--root', `${sha}^`, '--', fileName);
return gitCommand(repoPath, 'blame', '-fnw', '--root', `${sha}^`, '--', fileName);
}
console.log('git', 'blame', '-fnw', '--root', '--', fileName);
return gitCommand(repoPath, 'blame', '-fnw', '--root', '--', fileName);
// .then(s => { console.log(s); return s; })