|
|
@ -1,7 +1,7 @@ |
|
|
|
'use strict'; |
|
|
|
import { Arrays, Iterables } from '../system'; |
|
|
|
import { ExtensionContext, TreeItem, TreeItemCollapsibleState } from 'vscode'; |
|
|
|
import { ExplorerNode, ResourceType } from './explorerNode'; |
|
|
|
import { ExplorerNode, MessageNode, ResourceType } from './explorerNode'; |
|
|
|
import { GitService, GitUri } from '../gitService'; |
|
|
|
import { RemoteNode } from './remoteNode'; |
|
|
|
|
|
|
@ -15,7 +15,7 @@ export class RemotesNode extends ExplorerNode { |
|
|
|
|
|
|
|
async getChildren(): Promise<ExplorerNode[]> { |
|
|
|
const remotes = Arrays.uniqueBy(await this.git.getRemotes(this.uri.repoPath!), r => r.url, r => !!r.provider); |
|
|
|
if (remotes === undefined) return []; |
|
|
|
if (remotes === undefined || remotes.length === 0) return [new MessageNode('No remotes configured')]; |
|
|
|
|
|
|
|
remotes.sort((a, b) => a.name.localeCompare(b.name)); |
|
|
|
return [...Iterables.map(remotes, r => new RemoteNode(r, this.uri, this.context, this.git))]; |
|
|
|