Browse Source

Removes closed repos from fetch/pull/push commands

main
Eric Amodio 6 years ago
parent
commit
bc86b0e44c
2 changed files with 4 additions and 11 deletions
  1. +3
    -1
      src/git/gitService.ts
  2. +1
    -10
      src/views/nodes/repositoriesNode.ts

+ 3
- 1
src/git/gitService.ts View File

@ -1773,7 +1773,9 @@ export class GitService implements Disposable {
const repositories = [...(await this.getRepositories())];
if (repositories.length === 0) return repositories;
return repositories.sort((a, b) => (a.starred ? -1 : 1) - (b.starred ? -1 : 1) || a.index - b.index);
return repositories
.filter(r => !r.closed)
.sort((a, b) => (a.starred ? -1 : 1) - (b.starred ? -1 : 1) || a.index - b.index);
}
private async getRepositoryTree(): Promise<TernarySearchTree<Repository>> {

+ 1
- 10
src/views/nodes/repositoriesNode.ts View File

@ -39,14 +39,7 @@ export class RepositoriesNode extends SubscribeableViewNode {
const repositories = await Container.git.getOrderedRepositories();
if (repositories.length === 0) return [new MessageNode(this.view, this, 'No repositories could be found.')];
const children = [];
for (const repo of repositories) {
if (repo.closed) continue;
children.push(new RepositoryNode(GitUri.fromRepoPath(repo.path), this.view, this, repo));
}
this._children = children;
this._children = repositories.map(r => new RepositoryNode(GitUri.fromRepoPath(r.path), this.view, this, r));
}
return this._children;
@ -84,8 +77,6 @@ export class RepositoriesNode extends SubscribeableViewNode {
const children = [];
for (const repo of repositories) {
if (repo.closed) continue;
const normalizedPath = repo.normalizedPath;
const child = (this._children as RepositoryNode[]).find(c => c.repo.normalizedPath === normalizedPath);
if (child !== undefined) {

Loading…
Cancel
Save