mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-12 19:18:32 -05:00
Renames hosting to remote
This commit is contained in:
26
src/git/remotes/github.ts
Normal file
26
src/git/remotes/github.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
import { RemoteProvider } from './provider';
|
||||
|
||||
export class GitHubService extends RemoteProvider {
|
||||
|
||||
constructor(public domain: string, public path: string) {
|
||||
super(domain, path);
|
||||
}
|
||||
|
||||
get name() {
|
||||
return 'GitHub';
|
||||
}
|
||||
|
||||
protected getUrlForBranch(branch: string): string {
|
||||
return `${this.baseUrl}/tree/${branch}`;
|
||||
}
|
||||
|
||||
protected getUrlForCommit(sha: string): string {
|
||||
return `${this.baseUrl}/commit/${sha}`;
|
||||
}
|
||||
|
||||
protected getUrlForFile(fileName: string, sha?: string): string {
|
||||
if (sha) return `${this.baseUrl}/blob/${sha}/${fileName}`;
|
||||
return `${this.baseUrl}?path=${fileName}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user