Browse Source

Fixes #1303: Fix remote URLs for Azure DevOps

main
Travis Collins 4 years ago
committed by Eric Amodio
parent
commit
9b90b30cfb
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      src/git/remotes/azure-devops.ts

+ 7
- 3
src/git/remotes/azure-devops.ts View File

@ -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}`;
}
}

Loading…
Cancel
Save