Optimizes performance of git-log

This commit is contained in:
Eric Amodio
2017-02-18 17:17:08 -05:00
parent fc09e3a700
commit 4a88edd5ca
2 changed files with 4 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ export default class DiffWithWorkingCommand extends EditorCommand {
const gitUri = GitUri.fromUri(uri, this.git);
try {
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath);
const log = await this.git.getLogForFile(gitUri.fsPath, gitUri.sha, gitUri.repoPath, undefined, gitUri.sha ? undefined : 1);
if (!log) return window.showWarningMessage(`Unable to open diff. File is probably not under source control`);
commit = (gitUri.sha && log.commits.get(gitUri.sha)) || Iterables.first(log.commits.values());