mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 01:35:36 -05:00
27 lines
780 B
TypeScript
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}`;
|
|
}
|
|
} |