Parcourir la source

Add missing _git in Azure DevOps URLs.

main
Yan Zhang il y a 5 ans
committed by Eric Amodio
Parent
révision
070aa8ef65
1 fichiers modifiés avec 12 ajouts et 1 suppressions
  1. +12
    -1
      src/git/remotes/azure-devops.ts

+ 12
- 1
src/git/remotes/azure-devops.ts Voir le fichier

@ -11,11 +11,16 @@ const sshPathRegex = /^\/?v\d\//i;
export class AzureDevOpsRemote extends RemoteProvider { export class AzureDevOpsRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string) { constructor(domain: string, path: string, protocol?: string, name?: string) {
domain = domain.replace(sshDomainRegex, ''); domain = domain.replace(sshDomainRegex, '');
path = path.replace(sshPathRegex, '');
path = path.replace(sshPathRegex, '').replace(stripGitRegex, '/');
super(domain, path, protocol, name); super(domain, path, protocol, name);
} }
get baseUrl() {
const [orgAndProject, repo] = this.splitPath();
return `https://${this.domain}/${orgAndProject}/_git/${repo}`;
}
get icon() { get icon() {
return 'vsts'; return 'vsts';
} }
@ -58,4 +63,10 @@ export class AzureDevOpsRemote extends RemoteProvider {
if (branch) return `${this.baseUrl}/?path=%2F${fileName}&version=GB${branch}&_a=contents${line}`; if (branch) return `${this.baseUrl}/?path=%2F${fileName}&version=GB${branch}&_a=contents${line}`;
return `${this.baseUrl}?path=%2F${fileName}${line}`; return `${this.baseUrl}?path=%2F${fileName}${line}`;
} }
protected splitPath(): [string, string] {
const index = this.path.lastIndexOf('/');
return [this.path.substring(0, index), this.path.substring(index + 1)];
}
} }

Chargement…
Annuler
Enregistrer