From e893fac0ed5d85c0d0d0270a0b530d95c8d4baeb Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 1 Jul 2023 15:55:22 -0700 Subject: short hashes for og preview --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3e9f034..b7be4b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -480,6 +480,7 @@ async fn handle_commit_status(Path(path): Path<(String, String, String)>, State( eprintln!("path: {}/{}, sha {}", path.0, path.1, path.2); let remote_path = format!("{}/{}", path.0, path.1); let sha = path.2; + let short_sha = &sha[0..9]; let (commit_id, sha): (u64, String) = if sha.len() >= 7 { match ctx.dbctx.conn.lock().unwrap() @@ -544,13 +545,15 @@ async fn handle_commit_status(Path(path): Path<(String, String, String)>, State( head.push_str("\n"); head.push_str(&format!("\n")); head.push_str(&format!("\n")); - head.push_str(&format!("\n", &path.0, &path.1, &sha)); + head.push_str(&format!("", &path.0, &path.1, &short_sha)); let build_og_description = format!("commit {} of {}/{}, {} after {}", - sha, + short_sha, path.0, path.1, status_desc, display_run_time(&run) ); + head.push_str(&format!("", build_og_description)); head.push_str(&format!("", build_og_description)); } head.push_str("\n"); -- cgit v1.1