forked from tangled.org/core
this repo has no description

knotserver/xrpc: fix total commit count in repo log

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

anirudh.fi 3ac1e08c 1ec70a31

verified
Changed files
+11 -1
knotserver
+11 -1
knotserver/xrpc/repo_log.go
···
return
}
+
total, err := gr.TotalCommits()
+
if err != nil {
+
x.Logger.Error("fetching total commits", "error", err.Error())
+
writeError(w, xrpcerr.NewXrpcError(
+
xrpcerr.WithTag("InternalServerError"),
+
xrpcerr.WithMessage("failed to fetch total commits"),
+
), http.StatusNotFound)
+
return
+
}
+
// Create response using existing types.RepoLogResponse
response := types.RepoLogResponse{
Commits: commits,
Ref: ref,
Page: (offset / limit) + 1,
PerPage: limit,
-
Total: len(commits), // This is not accurate for pagination, but matches existing behavior
+
Total: total,
}
if path != "" {