fix(git): list every branch via one git ls-remote - #380
Open
mihir-kandoi wants to merge 2 commits into
Open
Conversation
The REST branch listing took a single per_page=100 page. GitHub sorts branches alphabetically, so branch-heavy repos lost their version-* tail: frappe/erpnext keeps version-16-hotfix at position 588 of 589, and the add-app dialog could never list it while showing lookalikes such as l10n_version-16-hotfix (position 69). ls-remote returns all heads in one round trip, costs no API rate limit (the public tab may be unauthenticated at 60 requests/hour), and reuses the header-based token plumbing clones already use. Authentication failures map to GitAuthError so the endpoint still marks stale tokens.
mihir-kandoi
force-pushed
the
fix/github-branch-pagination
branch
from
August 10, 2026 01:39
e6c8969 to
427eb8d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHubClient.list_branchesfetched a singleper_page=100REST page. GitHub sorts branches alphabetically, so branch-heavy repos silently lost theirversion-*tail — frappe/erpnext keepsversion-16-hotfixat position 588 of 589, so the add-app dialog's Branch dropdown could never show it while listing lookalikes likel10n_version-16-hotfix(position 69).Rather than paging the REST API (N requests against a 60/hour unauthenticated budget, plus an arbitrary cap to defend), this lists heads with one
git ls-remote: every branch, one round trip, no rate limit, using the same scoped-header token plumbing clones use. Git authentication failures map toGitAuthErrorso the endpoint keeps marking stale tokens invalid.Smoke-tested against frappe/erpnext: 589 branches returned,
version-16-hotfixpresent. Unit tests cover parsing, the token header (and that it stays out of argv), auth-failure mapping, other git failures, and timeouts. Independent of #377/#378.