Skip to content

Commit 9ad949b

Browse files
committed
🐛 fixes microsoft#24521
1 parent eae3739 commit 9ad949b

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

extensions/git/src/scmProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class GitSCMProvider {
100100
return;
101101
}
102102

103-
return toGitUri(uri, '');
103+
return toGitUri(uri, '', true);
104104
}
105105

106106
private onDidModelChange(): void {

extensions/git/src/uri.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ export function fromGitUri(uri: Uri): { path: string; ref: string; } {
1212
}
1313

1414
// As a mitigation for extensions like ESLint showing warnings and errors
15-
// for git URIs, let's change the file extension of these uris to .git.
16-
export function toGitUri(uri: Uri, ref: string): Uri {
15+
// for git URIs, let's change the file extension of these uris to .git,
16+
// when `replaceFileExtension` is true.
17+
export function toGitUri(uri: Uri, ref: string, replaceFileExtension = false): Uri {
1718
return uri.with({
1819
scheme: 'git',
19-
path: `${uri.path}.git`,
20+
path: replaceFileExtension ? `${uri.path}.git` : uri.path,
2021
query: JSON.stringify({
2122
path: uri.fsPath,
2223
ref

0 commit comments

Comments
 (0)