mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-12 19:18:32 -05:00
Reworks remote parsing
Combines same url into same remote Adds a change event for custom remote providers Adds a repo change event for custom remote providers
This commit is contained in:
@@ -5,23 +5,9 @@ export type GitRemoteType = 'fetch' | 'push';
|
||||
|
||||
export class GitRemote {
|
||||
|
||||
name: string;
|
||||
url: string;
|
||||
type: GitRemoteType;
|
||||
|
||||
provider?: RemoteProvider;
|
||||
|
||||
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 = RemoteProviderFactory.getRemoteProvider(this.url);
|
||||
constructor(public readonly repoPath: string, public readonly name: string, public readonly url: string, public readonly domain: string, public readonly path: string, public readonly types: GitRemoteType[]) {
|
||||
this.provider = RemoteProviderFactory.getRemoteProvider(this.domain, this.path);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user