tirbofish/kitgit · commit
b46b72acbe240b4917783132ad466c474d1d328f
merge: feat/signed-commits-ui into integrate/all-features
Type: SSH
SSH Key Fingerprint:
Verified
SgQHY4vUORbJC3ZtdixCl62ek/4QGh/iG2FRSyjfGPc
@@ -2900,6 +2900,7 @@ async fn commit_view( c: git::CommitInfo, extracted: Option<(String, Vec<u8>)>, ) -> CommitView { + let signed = extracted.is_some(); let verification = match extracted { Some((sig, payload)) => { git::verify_commit_signature( @@ -2934,6 +2935,7 @@ async fn commit_view( author: c.author, email: c.email, time: c.time, + signed, verified, verify_kind, verify_fingerprint, @@ -66,6 +66,8 @@ pub struct CommitView { pub author: String, pub email: String, pub time: i64, + /// True when a signature blob was present on the commit (SSH or GPG). + pub signed: bool, pub verified: bool, pub verify_kind: String, pub verify_fingerprint: String, @@ -73,6 +75,16 @@ pub struct CommitView { pub verified_at: String, } +impl CommitView { + pub fn verify_kind_label(&self) -> &'static str { + match self.verify_kind.as_str() { + "gpg" => "GPG", + "ssh" => "SSH", + _ => "Unknown", + } + } +} + pub struct CollaboratorView { pub user: User, pub role: String,
Large diffs are not rendered by default. Showing the first 50 of 307 lines. Show full diff