mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-09 13:40:28 +08:00
httpd: Fix commit count in repo stats in history route
Instead of using always the repo HEAD for the commit count with `repo::stats` we should use `repo::stats_from` and pass the `parent` commit. This way we allow e.g. a commit history for a peer with lesser commits to be counted correctly. Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
This commit is contained in:
committed by
Alexis Sellier
parent
ed62ac4264
commit
3fcadc5058
@@ -206,7 +206,7 @@ async fn history_handler(
|
||||
|
||||
let response = json!({
|
||||
"commits": commits,
|
||||
"stats": repo.stats()?,
|
||||
"stats": repo.stats_from(&sha)?,
|
||||
});
|
||||
|
||||
Ok::<_, Error>((StatusCode::OK, Json(response)))
|
||||
|
||||
Reference in New Issue
Block a user