mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 17:25:54 -05:00
Optimizes diff with previous command
This commit is contained in:
@@ -39,7 +39,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
|
||||
try {
|
||||
const sha = args.commit === undefined ? gitUri.sha : args.commit.sha;
|
||||
|
||||
const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, undefined, sha !== undefined ? undefined : 2, args.range!);
|
||||
const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, sha, { maxCount: 2, range: args.range!, skipMerges: true });
|
||||
if (log === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
|
||||
|
||||
args.commit = (sha && log.commits.get(sha)) || Iterables.first(log.commits.values());
|
||||
|
||||
Reference in New Issue
Block a user