Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 9959caa

Browse files
committed
Avoid using GraphQL repositories/ownerAffiliations
We should pass affiliations and ownerAffiliations the same RepositoryAffiliation?[], but ownerAffiliations doesn't currently exist on GitHub Enterprise. Luckily the default is Owner and Collaborator, which is what we need in this case (we can simply pass null).
1 parent 645db55 commit 9959caa

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ public async Task<ViewerRepositoriesModel> ReadViewerRepositories(HostAddress ad
7474
Direction = OrderDirection.Desc
7575
};
7676

77-
var affiliation = new RepositoryAffiliation?[]
78-
{
79-
RepositoryAffiliation.Owner, RepositoryAffiliation.Collaborator
80-
};
81-
8277
var repositorySelection = new Fragment<Repository, RepositoryListItemModel>(
8378
"repository",
8479
repo => new RepositoryListItemModel
@@ -95,7 +90,10 @@ public async Task<ViewerRepositoriesModel> ReadViewerRepositories(HostAddress ad
9590
.Select(viewer => new ViewerRepositoriesModel
9691
{
9792
Owner = viewer.Login,
98-
Repositories = viewer.Repositories(null, null, null, null, affiliation, null, null, order, affiliation, null)
93+
// We should pass affiliations and ownerAffiliations the same RepositoryAffiliation?[], but
94+
// ownerAffiliations doesn't currently exist on GitHub Enterprise. Luckily the default is
95+
// Owner and Collaborator, which is what we need in this case (we can simply pass null).
96+
Repositories = viewer.Repositories(null, null, null, null, null, null, null, order, null, null)
9997
.AllPages()
10098
.Select(repositorySelection).ToList(),
10199
ContributedToRepositories = viewer.RepositoriesContributedTo(100, null, null, null, null, null, null, order, null)

0 commit comments

Comments
 (0)