You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unify listBranches return shape across all adapters
All providers now return array{items, hasNext, nextCursor} so callers
get a consistent shape regardless of provider. GitHub uses true GraphQL
cursor pagination; GitLab/Gitea/Gogs/Forgejo compute hasNext from the
client-side slice and always return nextCursor: null. Error-path early
returns and the Gogs internal branch-existence check are updated to match.
Tests updated and testListBranchesNonExistingRepository added for GitLab
and Gitea (inherited by Gogs and Forgejo).
* Search is prefix-based: 'feat' matches 'feature-branch' but not 'my-feature'.
227
+
* GitHub uses true server-side cursor pagination via GraphQL; pass the returned
228
+
* nextCursor as $page on subsequent calls to advance the page.
229
+
* Other providers (GitLab, Gitea, Gogs, Forgejo) fetch all matching branches
230
+
* client-side and slice; for them nextCursor is always null, but hasNext
231
+
* correctly reflects whether more items exist beyond the current slice.
225
232
*
226
233
* @param string $owner Owner name of the repository
227
234
* @param string $repositoryName Name of the repository
228
-
* @param int $perPage Number of branches to fetch per page
229
-
* @param int|string|null $page Page number or cursor to start fetching from
230
-
* @param string $search Branch name prefix search query
231
-
* @return array<string>|array{items: array<string>, hasNext: bool, nextCursor?: string|null} List of branch names or branch names with pagination metadata
235
+
* @param int $perPage Number of results per page, clamped to [1, 100]
236
+
* @param int|string|null $page 1-based integer page number, or an opaque cursor string from a previous nextCursor (cursor form only supported by GitHub)
237
+
* @param string $search Prefix filter for branch names; empty string returns all branches
0 commit comments