Skip to content

Commit bc86b0e

Browse files
committed
Removes closed repos from fetch/pull/push commands
1 parent 4fa8a48 commit bc86b0e

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/git/gitService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,9 @@ export class GitService implements Disposable {
17731773
const repositories = [...(await this.getRepositories())];
17741774
if (repositories.length === 0) return repositories;
17751775

1776-
return repositories.sort((a, b) => (a.starred ? -1 : 1) - (b.starred ? -1 : 1) || a.index - b.index);
1776+
return repositories
1777+
.filter(r => !r.closed)
1778+
.sort((a, b) => (a.starred ? -1 : 1) - (b.starred ? -1 : 1) || a.index - b.index);
17771779
}
17781780

17791781
private async getRepositoryTree(): Promise<TernarySearchTree<Repository>> {

src/views/nodes/repositoriesNode.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,7 @@ export class RepositoriesNode extends SubscribeableViewNode<RepositoriesView> {
3939
const repositories = await Container.git.getOrderedRepositories();
4040
if (repositories.length === 0) return [new MessageNode(this.view, this, 'No repositories could be found.')];
4141

42-
const children = [];
43-
for (const repo of repositories) {
44-
if (repo.closed) continue;
45-
46-
children.push(new RepositoryNode(GitUri.fromRepoPath(repo.path), this.view, this, repo));
47-
}
48-
49-
this._children = children;
42+
this._children = repositories.map(r => new RepositoryNode(GitUri.fromRepoPath(r.path), this.view, this, r));
5043
}
5144

5245
return this._children;
@@ -84,8 +77,6 @@ export class RepositoriesNode extends SubscribeableViewNode<RepositoriesView> {
8477

8578
const children = [];
8679
for (const repo of repositories) {
87-
if (repo.closed) continue;
88-
8980
const normalizedPath = repo.normalizedPath;
9081
const child = (this._children as RepositoryNode[]).find(c => c.repo.normalizedPath === normalizedPath);
9182
if (child !== undefined) {

0 commit comments

Comments
 (0)