Skip to content

Commit 4538dbb

Browse files
authored
Merge pull request #2149 from hmacr/1we24-auto-suggest-default-branch
Use defaultBranch from VCS in ProductionBranch field
2 parents 5aa9f31 + d3ba681 commit 4538dbb

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"dependencies": {
2424
"@ai-sdk/svelte": "^1.1.24",
25-
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@8836b0c",
25+
"@appwrite.io/console": "https://pkg.pr.new/appwrite-labs/cloud/@appwrite.io/console@2289",
2626
"@appwrite.io/pink-icons": "0.25.0",
2727
"@appwrite.io/pink-icons-svelte": "^2.0.0-RC.1",
2828
"@appwrite.io/pink-legacy": "^1.0.3",

pnpm-lock.yaml

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/components/git/productionBranchFieldset.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
let show = false;
1717
1818
async function loadBranches() {
19+
const repo = await sdk
20+
.forProject(page.params.region, page.params.project)
21+
.vcs.getRepository(installationId, repositoryId);
22+
23+
branch = repo.defaultBranch ?? 'main';
24+
1925
const { branches } = await sdk
2026
.forProject(page.params.region, page.params.project)
2127
.vcs.listRepositoryBranches(installationId, repositoryId);
22-
const sorted = sortBranches(branches);
23-
branch = sorted[0]?.name ?? null;
24-
25-
if (!branch) {
26-
branch = 'main';
27-
}
2828
29-
return sorted;
29+
return sortBranches(branches);
3030
}
3131
</script>
3232

0 commit comments

Comments
 (0)