mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-30 09:35:42 -05:00
Adds GitLab remote link support
Adds Bitbucket remote link support Adds Visual Studio Team Services remote link support
This commit is contained in:
27
src/git/remotes/bitbucket.ts
Normal file
27
src/git/remotes/bitbucket.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
'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}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user