mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-18 09:45:36 -05:00
Adds experimental support for Open in GitHub
This commit is contained in:
@@ -4,4 +4,5 @@ export * from './branch';
|
||||
export * from './commit';
|
||||
export * from './log';
|
||||
export * from './logCommit';
|
||||
export * from './remote';
|
||||
export * from './status';
|
||||
27
src/git/models/remote.ts
Normal file
27
src/git/models/remote.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
import { HostingProvider, HostingProviderFactory } from '../hosting/factory';
|
||||
|
||||
export type GitRemoteType = 'fetch' | 'push';
|
||||
|
||||
export class GitRemote {
|
||||
|
||||
name: string;
|
||||
url: string;
|
||||
type: GitRemoteType;
|
||||
|
||||
provider?: HostingProvider;
|
||||
|
||||
constructor(remote: string) {
|
||||
remote = remote.trim();
|
||||
|
||||
const [name, info] = remote.split('\t');
|
||||
this.name = name;
|
||||
|
||||
const [url, typeInfo] = info.split(' ');
|
||||
this.url = url;
|
||||
|
||||
this.type = typeInfo.substring(1, typeInfo.length - 1) as GitRemoteType;
|
||||
|
||||
this.provider = HostingProviderFactory.getHostingProvider(this.url);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user