Skip to content

Commit f7b2638

Browse files
committed
Fixes issues with diff trying to use a range
Removes range because it is unnecessary
1 parent 363a0e9 commit f7b2638

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/commands/diffWithPrevious.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22
import { Iterables } from '../system';
3-
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
3+
import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
44
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
55
import { Container } from '../container';
66
import { DiffWithCommandArgs } from './diffWith';
@@ -11,7 +11,6 @@ import { Messages } from '../messages';
1111

1212
export interface DiffWithPreviousCommandArgs {
1313
commit?: GitCommit;
14-
range?: Range;
1514

1615
line?: number;
1716
showOptions?: TextDocumentShowOptions;
@@ -32,7 +31,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
3231
args.line = editor === undefined ? 0 : editor.selection.active.line;
3332
}
3433

35-
if (args.commit === undefined || !args.commit.isFile || args.range !== undefined) {
34+
if (args.commit === undefined || !args.commit.isFile) {
3635
const gitUri = await GitUri.fromUri(uri);
3736

3837
try {
@@ -46,7 +45,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
4645
isStagedUncommitted = true;
4746
}
4847

49-
const log = await Container.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, { maxCount: 2, range: args.range!, ref: sha, skipMerges: true });
48+
const log = await Container.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, { maxCount: 2, ref: sha, skipMerges: true });
5049
if (log === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
5150

5251
args.commit = (sha && log.commits.get(sha)) || Iterables.first(log.commits.values());

src/gitCodeLensProvider.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
355355
arguments: [
356356
Uri.file(lens.uri!.fsPath),
357357
{
358-
commit: commit,
359-
range: lens.isFullRange ? undefined : lens.blameRange
358+
commit: commit
360359
} as DiffWithPreviousCommandArgs
361360
]
362361
};

0 commit comments

Comments
 (0)