Browse Source

Fixes #501 - azure devops support (ssh)

main
Eric Amodio 6 years ago
parent
commit
d64a1f881e
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      src/git/remotes/azure-devops.ts

+ 8
- 2
src/git/remotes/azure-devops.ts View File

@ -2,11 +2,17 @@
import { Range } from 'vscode';
import { RemoteProvider } from './provider';
const issueEnricherRegEx = /(^|\s)(#([0-9]+))\b/gi;
const issueEnricherRegex = /(^|\s)(#([0-9]+))\b/gi;
const stripGitRegex = /\/_git\/?/i;
const sshDomainRegex = /^ssh\./i;
const sshPathRegex = /^\/?v\d\//i;
export class AzureDevOpsRemote extends RemoteProvider {
constructor(domain: string, path: string, protocol?: string, name?: string) {
domain = domain.replace(sshDomainRegex, '');
path = path.replace(sshPathRegex, '');
super(domain, path, protocol, name);
}
@ -22,7 +28,7 @@ export class AzureDevOpsRemote extends RemoteProvider {
// Strip off any `_git` part from the repo url
const baseUrl = this.baseUrl.replace(stripGitRegex, '/');
// Matches #123
return message.replace(issueEnricherRegEx, `$1[$2](${baseUrl}/_workitems/edit/$3 "Open Work Item $2")`);
return message.replace(issueEnricherRegex, `$1[$2](${baseUrl}/_workitems/edit/$3 "Open Work Item $2")`);
}
protected getUrlForBranches(): string {

Loading…
Cancel
Save