Show canonical branches and tags in peer selector

This commit is contained in:
Rūdolfs Ošiņš
2026-04-22 09:45:00 +02:00
parent 42bc27c1f8
commit ecbea99f56
14 changed files with 631 additions and 83 deletions
+24
View File
@@ -266,3 +266,27 @@ export function formatQualifiedRefname(
): string {
return peer ? `refs/namespaces/${peer}/refs/heads/${refname}` : refname;
}
export function getBranchesFromRefs(
refs: Record<string, string>,
): Record<string, string> {
const branches: Record<string, string> = {};
for (const [name, oid] of Object.entries(refs)) {
if (name.startsWith("refs/heads/")) {
branches[name.slice("refs/heads/".length)] = oid;
}
}
return branches;
}
export function getTagsFromRefs(
refs: Record<string, string>,
): Record<string, string> {
const tags: Record<string, string> = {};
for (const [name, oid] of Object.entries(refs)) {
if (name.startsWith("refs/tags/")) {
tags[name.slice("refs/tags/".length)] = oid;
}
}
return tags;
}