diff --git a/src/git/remotes/azure-devops.ts b/src/git/remotes/azure-devops.ts index d0dc152..f6d40e5 100644 --- a/src/git/remotes/azure-devops.ts +++ b/src/git/remotes/azure-devops.ts @@ -35,6 +35,10 @@ export class AzureDevOpsRemote extends RemoteProvider { } } + // Azure DevOps allows projects and repository names with spaces. In that situation, + // the `path` will be previously encoded during git clone + // revert that encoding to avoid double-encoding by gitlens during copy remote and open remote + path = decodeURIComponent(path); super(domain, path, protocol, name); } @@ -131,8 +135,8 @@ export class AzureDevOpsRemote extends RemoteProvider { line = ''; } - if (sha) return `${this.baseUrl}/commit/${sha}/?_a=contents&path=%2F${fileName}${line}`; - if (branch) return `${this.baseUrl}/?path=%2F${fileName}&version=GB${branch}&_a=contents${line}`; - return `${this.baseUrl}?path=%2F${fileName}${line}`; + if (sha) return `${this.baseUrl}/commit/${sha}/?_a=contents&path=/${fileName}${line}`; + if (branch) return `${this.baseUrl}/?path=/${fileName}&version=GB${branch}&_a=contents${line}`; + return `${this.baseUrl}?path=/${fileName}${line}`; } }