diff options
Diffstat (limited to 'src/lib/git')
| -rw-r--r-- | src/lib/git/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs index 875a336..5d14ce3 100644 --- a/src/lib/git/mod.rs +++ b/src/lib/git/mod.rs | |||
| @@ -6,7 +6,10 @@ use std::{ | |||
| 6 | use anyhow::{bail, Context, Result}; | 6 | use anyhow::{bail, Context, Result}; |
| 7 | use git2::{DiffOptions, Oid, Revwalk}; | 7 | use git2::{DiffOptions, Oid, Revwalk}; |
| 8 | pub use identify_ahead_behind::identify_ahead_behind; | 8 | pub use identify_ahead_behind::identify_ahead_behind; |
| 9 | use nostr_sdk::hashes::{sha1::Hash as Sha1Hash, Hash}; | 9 | use nostr_sdk::{ |
| 10 | hashes::{sha1::Hash as Sha1Hash, Hash}, | ||
| 11 | Tags, | ||
| 12 | }; | ||
| 10 | 13 | ||
| 11 | use crate::git_events::{get_commit_id_from_patch, tag_value}; | 14 | use crate::git_events::{get_commit_id_from_patch, tag_value}; |
| 12 | pub mod identify_ahead_behind; | 15 | pub mod identify_ahead_behind; |
| @@ -836,10 +839,7 @@ fn git_sig_to_tag_vec(sig: &git2::Signature) -> Vec<String> { | |||
| 836 | ] | 839 | ] |
| 837 | } | 840 | } |
| 838 | 841 | ||
| 839 | fn extract_sig_from_patch_tags<'a>( | 842 | fn extract_sig_from_patch_tags<'a>(tags: &'a Tags, tag_name: &str) -> Result<git2::Signature<'a>> { |
| 840 | tags: &'a [nostr::Tag], | ||
| 841 | tag_name: &str, | ||
| 842 | ) -> Result<git2::Signature<'a>> { | ||
| 843 | let v = tags | 843 | let v = tags |
| 844 | .iter() | 844 | .iter() |
| 845 | .find(|t| t.as_slice()[0].eq(tag_name)) | 845 | .find(|t| t.as_slice()[0].eq(tag_name)) |
| @@ -1092,10 +1092,10 @@ mod tests { | |||
| 1092 | fn test(time: git2::Time) -> Result<()> { | 1092 | fn test(time: git2::Time) -> Result<()> { |
| 1093 | assert_eq!( | 1093 | assert_eq!( |
| 1094 | extract_sig_from_patch_tags( | 1094 | extract_sig_from_patch_tags( |
| 1095 | &[nostr::Tag::custom( | 1095 | &Tags::new(vec![nostr::Tag::custom( |
| 1096 | nostr::TagKind::Custom("author".to_string().into()), | 1096 | nostr::TagKind::Custom("author".to_string().into()), |
| 1097 | prep(&time)?, | 1097 | prep(&time)?, |
| 1098 | )], | 1098 | )]), |
| 1099 | "author", | 1099 | "author", |
| 1100 | )? | 1100 | )? |
| 1101 | .to_string(), | 1101 | .to_string(), |