Browse Source

Fixes remote url issue with spaces in the filename

main
Eric Amodio 4 years ago
parent
commit
bc4ae413d7
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      src/git/remotes/provider.ts

+ 6
- 6
src/git/remotes/provider.ts View File

@ -107,7 +107,7 @@ export abstract class RemoteProvider {
async copy(resource: RemoteResource): Promise<void> {
const url = this.url(resource);
if (url === undefined) return;
if (url == null) return;
try {
void (await env.clipboard.writeText(url));
@ -150,8 +150,8 @@ export abstract class RemoteProvider {
return this.getUrlForCommit(encodeURIComponent(resource.sha));
case RemoteResourceType.File:
return this.getUrlForFile(
resource.fileName,
resource.branch !== undefined ? encodeURIComponent(resource.branch) : undefined,
encodeURIComponent(resource.fileName),
resource.branch != null ? encodeURIComponent(resource.branch) : undefined,
undefined,
resource.range,
);
@ -159,9 +159,9 @@ export abstract class RemoteProvider {
return this.getUrlForRepository();
case RemoteResourceType.Revision:
return this.getUrlForFile(
resource.fileName,
resource.branch !== undefined ? encodeURIComponent(resource.branch) : undefined,
resource.sha !== undefined ? encodeURIComponent(resource.sha) : undefined,
encodeURIComponent(resource.fileName),
resource.branch != null ? encodeURIComponent(resource.branch) : undefined,
resource.sha != null ? encodeURIComponent(resource.sha) : undefined,
resource.range,
);
default:

Loading…
Cancel
Save