Skip to content

Commit

Permalink
Fixes #501 - azure devops support (ssh)
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Dec 6, 2018
1 parent 4e801bc commit d64a1f8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/git/remotes/azure-devops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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 {
Expand Down

0 comments on commit d64a1f8

Please sign in to comment.