Files
vscode-gitlens/src/git/remotes/bitbucket.ts
Eric Amodio 851522f593 Adds GitLab remote link support
Adds Bitbucket remote link support
Adds Visual Studio Team Services remote link support
2017-03-28 01:28:03 -04:00

27 lines
780 B
TypeScript

'use strict';
import { RemoteProvider } from './provider';
export class BitbucketService extends RemoteProvider {
constructor(public domain: string, public path: string) {
super(domain, path);
}
get name() {
return 'Bitbucket';
}
protected getUrlForBranch(branch: string): string {
return `${this.baseUrl}/commits/branch/${branch}`;
}
protected getUrlForCommit(sha: string): string {
return `${this.baseUrl}/commits/${sha}`;
}
protected getUrlForFile(fileName: string, branch?: string, sha?: string): string {
if (sha) return `${this.baseUrl}/src/${sha}/${fileName}`;
if (branch) return `${this.baseUrl}/src/${branch}/${fileName}`;
return `${this.baseUrl}?path=${fileName}`;
}
}