From ae75d1468f87b6317cb5f1f59d2e53c6c5579478 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 11 Jun 2026 16:48:33 +0530 Subject: [PATCH] simplify branch fetch --- .../git/productionBranchFieldset.svelte | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/src/lib/components/git/productionBranchFieldset.svelte b/src/lib/components/git/productionBranchFieldset.svelte index 5a15963d8..6785d6499 100644 --- a/src/lib/components/git/productionBranchFieldset.svelte +++ b/src/lib/components/git/productionBranchFieldset.svelte @@ -26,29 +26,15 @@ branch = repo.defaultBranch ?? 'main'; - const allBranches = []; - let offset = 0; - const limit = 100; + const { branches } = await sdk + .forProject(page.params.region, page.params.project) + .vcs.listRepositoryBranches({ + installationId, + providerRepositoryId: repositoryId, + queries: [Query.limit(1000)] + }); - while (true) { - const { branches, total } = await sdk - .forProject(page.params.region, page.params.project) - .vcs.listRepositoryBranches({ - installationId, - providerRepositoryId: repositoryId, - queries: [Query.limit(limit), Query.offset(offset)] - }); - - allBranches.push(...branches); - - if (allBranches.length >= total || branches.length < limit) { - break; - } - - offset += limit; - } - - return sortBranches(allBranches); + return sortBranches(branches); }