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:
parent
a41f67d9ef
commit
0e0ff38ff7
|
|
@ -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)))
|
||||
|
|
|
|||
Loading…
Reference in New Issue