Explorar el Código

Adds message in custom view if no remotes

main
Eric Amodio hace 7 años
padre
commit
a5af318269
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. +2
    -2
      src/views/remotesNode.ts

+ 2
- 2
src/views/remotesNode.ts Ver fichero

@ -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))];

Cargando…
Cancelar
Guardar