Author:
Hash:
Timestamp:
+8 -12 +/-2 browse
Kevin Schoon [me@kevinschoon.com]
dee0c4379349ac89f16fde9e917b832fa900ef42
Sun, 20 Jul 2025 15:33:49 +0000 (8 months ago)
| 1 | diff --git a/ayllu/src/web2/routes/log.rs b/ayllu/src/web2/routes/log.rs |
| 2 | index 20ce81c..4b4d750 100644 |
| 3 | --- a/ayllu/src/web2/routes/log.rs |
| 4 | +++ b/ayllu/src/web2/routes/log.rs |
| 5 | @@ -35,7 +35,7 @@ pub async fn serve( |
| 6 | Extension(preamble): Extension<Preamble>, |
| 7 | ConfigReader(config): ConfigReader, |
| 8 | Extension(mut base): Extension<Base>, |
| 9 | - params: Query<Option<HashMap<String, String>>>, |
| 10 | + params: Query<HashMap<String, String>>, |
| 11 | ) -> Result<Html<String>, Error> { |
| 12 | let repository = Wrapper::new(preamble.repo_path.as_path())?; |
| 13 | base.nav_elements = |
| 14 | @@ -73,13 +73,9 @@ pub async fn serve( |
| 15 | None => { |
| 16 | base.title = format!("Log: {}", preamble.repo_name); |
| 17 | let commits = repository.log(Selector { |
| 18 | - commit: preamble.latest_commit_id.clone(), |
| 19 | - username: params |
| 20 | - .as_ref() |
| 21 | - .and_then(|params| params.get("username").cloned()), |
| 22 | - email: params |
| 23 | - .as_ref() |
| 24 | - .and_then(|params| params.get("email").cloned()), |
| 25 | + commit: preamble.latest_commit_id.clone().as_ref(), |
| 26 | + username: params.get("username"), |
| 27 | + email: params.get("email"), |
| 28 | limit: Some(config.items_per_page as i64), |
| 29 | })?; |
| 30 | with_preamble!(base, preamble); |
| 31 | diff --git a/crates/git/src/wrapper.rs b/crates/git/src/wrapper.rs |
| 32 | index 1300a23..f4b9431 100644 |
| 33 | --- a/crates/git/src/wrapper.rs |
| 34 | +++ b/crates/git/src/wrapper.rs |
| 35 | @@ -20,10 +20,10 @@ use crate::lite; |
| 36 | // maximum blob size we are willing to load into memory |
| 37 | const MAX_BLOB_SIZE: i32 = 1024 * 1024 * 8; |
| 38 | |
| 39 | - pub struct Selector { |
| 40 | - pub commit: Option<String>, |
| 41 | - pub username: Option<String>, |
| 42 | - pub email: Option<String>, |
| 43 | + pub struct Selector<'a> { |
| 44 | + pub commit: Option<&'a String>, |
| 45 | + pub username: Option<&'a String>, |
| 46 | + pub email: Option<&'a String>, |
| 47 | pub limit: Option<i64>, |
| 48 | } |
| 49 |