git_checks_core/
impl_prelude.rs1pub use std::error::Error;
12
13pub use git_workarea::CommitId;
14pub use git_workarea::GitError;
15pub use git_workarea::Identity;
16
17pub use crate::check::BranchCheck;
18pub use crate::check::Check;
19pub use crate::check::CheckResult;
20pub use crate::check::ContentCheck;
21pub use crate::check::TopicCheck;
22pub use crate::commit::Commit;
23pub use crate::commit::CommitError;
24pub use crate::commit::Content;
25pub use crate::commit::DiffInfo;
26pub use crate::commit::FileName;
27pub use crate::commit::StatusChange;
28pub use crate::commit::Topic;
29pub use crate::context::AttributeState;
30pub use crate::context::CheckGitContext;
31pub use crate::utils::SubmoduleContext;
32
33pub fn commit_prefix(content: &dyn Content) -> String {
35 if let Some(sha1) = content.sha1() {
36 format!("commit {} ", sha1)
37 } else {
38 String::new()
39 }
40}
41
42pub fn commit_prefix_str<M>(content: &dyn Content, msg: M) -> String
44where
45 M: AsRef<str>,
46{
47 if let Some(sha1) = content.sha1() {
48 format!("commit {} {} ", sha1, msg.as_ref())
49 } else {
50 String::new()
51 }
52}