This commit is contained in:
Joao Moreno
2017-04-11 16:26:54 +02:00
parent eae373999d
commit 9ad949b99b
2 changed files with 5 additions and 4 deletions

View File

@@ -12,11 +12,12 @@ export function fromGitUri(uri: Uri): { path: string; ref: string; } {
}
// As a mitigation for extensions like ESLint showing warnings and errors
// for git URIs, let's change the file extension of these uris to .git.
export function toGitUri(uri: Uri, ref: string): Uri {
// for git URIs, let's change the file extension of these uris to .git,
// when `replaceFileExtension` is true.
export function toGitUri(uri: Uri, ref: string, replaceFileExtension = false): Uri {
return uri.with({
scheme: 'git',
path: `${uri.path}.git`,
path: replaceFileExtension ? `${uri.path}.git` : uri.path,
query: JSON.stringify({
path: uri.fsPath,
ref