explorer: Fetch only the tip commit header for repo cards

Repo cards fetched their tip commit from `/commits/:sha` only to show
when it was made. That endpoint diffs the commit and inlines its
blobs, so every repo listing made httpd diff the tip commit of each
repo on the page.

Take the commit from `/commits?parent=:sha&perPage=1` instead, which
returns only the commit header.
This commit is contained in:
Rūdolfs Ošiņš
2026-12-01 16:30:56 +01:00
parent 180b594749
commit 01d3a69a04
+7 -3
View File
@@ -30,6 +30,11 @@
$: baseUrl = repoInfo.baseUrl;
$: isPrivate = repo.visibility.type === "private";
$: tip = defaultBranchTip(repo);
$: tipCommit = tip
? api.repo
.getAllCommits(repo.rid, { parent: tip, perPage: 1 })
.then(commits => commits[0])
: undefined;
</script>
<style>
@@ -229,9 +234,8 @@
<Icon name="patch" />
{repo.cobs.patches.open}
{/if}
{#await tip && api.repo.getCommitBySha(repo.rid, tip) then result}
{#if result}
{@const commit = result.commit}
{#await tipCommit then commit}
{#if commit}
<span
class="txt-body-m-regular"
style:margin-left="auto"