Monorepo for Tangled tangled.org

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
··· 73 73 return 74 74 } 75 75 76 + total, err := gr.TotalCommits() 77 + if err != nil { 78 + x.Logger.Error("fetching total commits", "error", err.Error()) 79 + writeError(w, xrpcerr.NewXrpcError( 80 + xrpcerr.WithTag("InternalServerError"), 81 + xrpcerr.WithMessage("failed to fetch total commits"), 82 + ), http.StatusNotFound) 83 + return 84 + } 85 + 76 86 // Create response using existing types.RepoLogResponse 77 87 response := types.RepoLogResponse{ 78 88 Commits: commits, 79 89 Ref: ref, 80 90 Page: (offset / limit) + 1, 81 91 PerPage: limit, 82 - Total: len(commits), // This is not accurate for pagination, but matches existing behavior 92 + Total: total, 83 93 } 84 94 85 95 if path != "" {