Skip to content

Commit a7436a3

Browse files
committed
Fixes range handling
Introduced by 51efd0c
1 parent 96f7001 commit a7436a3

File tree

1 file changed

+7
-2
lines changed
  • src/env/node/git/sub-providers

1 file changed

+7
-2
lines changed

src/env/node/git/sub-providers/diff.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
parseGitLogSimpleFormat,
2424
parseGitLogSimpleRenamed,
2525
} from '../../../../git/parsers/logParser';
26-
import { isUncommittedStaged } from '../../../../git/utils/revision.utils';
26+
import { isRevisionRange, isUncommittedStaged } from '../../../../git/utils/revision.utils';
2727
import { showGenericErrorMessage } from '../../../../messages';
2828
import { configuration } from '../../../../system/-webview/configuration';
2929
import { splitPath } from '../../../../system/-webview/path';
@@ -53,7 +53,12 @@ export class DiffGitSubProvider implements GitDiffSubProvider {
5353

5454
const args: string[] = [];
5555
if (to != null) {
56-
prepareToFromDiffArgs(to, from, args);
56+
// Handle revision ranges specially if there is no `from`, otherwise `prepareToFromDiffArgs` will duplicate the range
57+
if (isRevisionRange(to) && from == null) {
58+
args.push(to);
59+
} else {
60+
prepareToFromDiffArgs(to, from, args);
61+
}
5762
}
5863

5964
try {

0 commit comments

Comments
 (0)