()
| 1048 | // won't be found under the origin repo name. Look it up among the user's repos, |
| 1049 | // which are usually far fewer than the origin's forks. |
| 1050 | async findUserFork(): Promise<ForgejoRepository | undefined> { |
| 1051 | try { |
| 1052 | const repos = await this.requestAllPages<ForgejoRepository>('/user/repos', { |
| 1053 | params: { limit: 50 }, |
| 1054 | }); |
| 1055 | return repos.find( |
| 1056 | repo => |
| 1057 | repo.owner.login.toLowerCase() === this.repoOwner.toLowerCase() && |
| 1058 | this.isForkOfOrigin(repo), |
| 1059 | ); |
| 1060 | } catch { |
| 1061 | return undefined; |
| 1062 | } |
| 1063 | } |
| 1064 | |
| 1065 | async createFork(): Promise<ForgejoRepository> { |
| 1066 | return this.request(`${this.originRepoURL}/forks`, { |
no test coverage detected