Skip to content

Commit

Permalink
Fixes #649 - missing remotes w/o proper urls
Browse files Browse the repository at this point in the history
  • Loading branch information
eamodio committed Jul 30, 2019
1 parent 529f72c commit d5f8abe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Fixed

- Fixes [#649](https://github.com/eamodio/vscode-gitlens/issues/649) - GitLens can't see the remote but git can
- Fixes [#798](https://github.com/eamodio/vscode-gitlens/issues/798) - git pull/fetch all repositories
- Fixes [#805](https://github.com/eamodio/vscode-gitlens/issues/805) - Version 9.9.1 breaks working tree comparison

Expand Down
4 changes: 2 additions & 2 deletions src/git/parsers/remoteParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class GitRemoteParser {

[scheme, domain, path] = this.parseGitUrl(url);

uniqueness = `${domain}/${path}`;
uniqueness = `${domain ? `${domain}/` : ''}${path}`;
remote = groups[uniqueness];
if (remote === undefined) {
const provider = providerFactory(domain, path);
Expand Down Expand Up @@ -113,7 +113,7 @@ export class GitRemoteParser {

static parseGitUrl(url: string): [string, string, string] {
const match = urlRegex.exec(url);
if (match == null) return [emptyStr, emptyStr, emptyStr];
if (match == null) return [emptyStr, emptyStr, url];

return [
match[1] || match[3] || match[6],
Expand Down
14 changes: 9 additions & 5 deletions src/views/nodes/remoteNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,15 @@ export class RemoteNode extends ViewNode<RepositoriesView> {
`${this.remote.default ? `${GlyphChars.Check} ${GlyphChars.Space}` : ''}${this.remote.name}`,
TreeItemCollapsibleState.Collapsed
);
item.description = `${arrows}${GlyphChars.Space} ${
this.remote.provider !== undefined ? this.remote.provider.name : this.remote.domain
} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} ${
this.remote.provider !== undefined ? this.remote.provider.displayPath : this.remote.path
}`;

item.description =
this.remote.provider !== undefined
? `${arrows}${GlyphChars.Space} ${this.remote.provider.name} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} ${this.remote.provider.displayPath}`
: `${arrows}${GlyphChars.Space} ${
this.remote.domain
? `${this.remote.domain} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} `
: ''
}${this.remote.path}`;
item.contextValue = ResourceType.Remote;
if (this.remote.default) {
item.contextValue += '+default';
Expand Down

0 comments on commit d5f8abe

Please sign in to comment.