Fixes issues with diff with previous

Wouldn't always grab the correct commit
This commit is contained in:
Eric Amodio
2017-02-13 11:42:54 -05:00
parent 3ef538b713
commit d5d0c3a28d
6 changed files with 20 additions and 48 deletions

View File

@@ -441,7 +441,7 @@ export default class GitProvider extends Disposable {
Logger.log(`getLogForFile('${fileName}', ${sha}, ${repoPath}, ${range && `[${range.start.line}, ${range.end.line}]`}, ${maxCount})`);
fileName = Git.normalizePath(fileName);
const useCaching = this.UseGitCaching && !range && !maxCount;
const useCaching = this.UseGitCaching && !sha && !range && !maxCount;
let cacheKey: string;
let entry: GitCacheEntry;
@@ -464,7 +464,7 @@ export default class GitProvider extends Disposable {
return (range
? Git.logRange(fileName, range.start.line + 1, range.end.line + 1, sha, repoPath, maxCount)
: Git.log(fileName, sha, repoPath, maxCount))
.then(data => new GitLogParserEnricher().enrich(data, fileName))
.then(data => new GitLogParserEnricher().enrich(data, repoPath || fileName, !!repoPath))
.catch(ex => {
// Trap and cache expected log errors
if (useCaching) {