Use the dedicated commit-count endpoint

So the header and history stop fetching full tree stats just for the
commit count. Falls back to the previous behaviour when the backend
doesn't serve the new endpoint.
This commit is contained in:
Rūdolfs Ošiņš
2026-07-29 09:36:31 +02:00
parent 436085c154
commit faa21f4504
4 changed files with 40 additions and 5 deletions
+2 -2
View File
@@ -47,8 +47,8 @@
let totalCommits: number | undefined = undefined;
function fetchTotalCommits(rid: string, sha: string) {
void api.repo.getTreeStatsBySha(rid, sha).then(stats => {
totalCommits = stats.commits;
void api.repo.getCommitCountBySha(rid, sha).then(commits => {
totalCommits = commits;
});
}
+3 -3
View File
@@ -40,9 +40,9 @@
if (cached !== undefined) {
commitCount = cached;
} else {
void api.repo.getTreeStatsBySha(rid, sha).then(stats => {
commitCountCache[sha] = stats.commits;
commitCount = stats.commits;
void api.repo.getCommitCountBySha(rid, sha).then(commits => {
commitCountCache[sha] = commits;
commitCount = commits;
});
}
}