From bc4ae413d79c99fb3068f484e93376d1a693dcca Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Sun, 18 Oct 2020 01:58:17 -0400 Subject: [PATCH] Fixes remote url issue with spaces in the filename --- src/git/remotes/provider.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/git/remotes/provider.ts b/src/git/remotes/provider.ts index 22c2b6b..c3398db 100644 --- a/src/git/remotes/provider.ts +++ b/src/git/remotes/provider.ts @@ -107,7 +107,7 @@ export abstract class RemoteProvider { async copy(resource: RemoteResource): Promise { 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: