1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
pub use crates::git_workarea::CommitId;
pub use crates::git_workarea::Identity;
pub use commit::Commit;
pub use commit::Content;
pub use commit::DiffInfo;
pub use commit::FileName;
pub use commit::StatusChange;
pub use commit::Topic;
pub use check::BranchCheck;
pub use check::Check;
pub use check::ContentCheck;
pub use check::CheckResult;
pub use check::TopicCheck;
pub use context::AttributeState;
pub use context::CheckGitContext;
pub use error::Error;
pub use error::ErrorKind;
pub use error::Result;
pub use error::ResultExt;
pub use utils::SubmoduleContext;
pub fn commit_prefix(content: &Content) -> String {
if let Some(sha1) = content.sha1() {
format!("commit {} ", sha1)
} else {
String::new()
}
}
pub fn commit_prefix_str<M>(content: &Content, msg: M) -> String
where M: AsRef<str>,
{
if let Some(sha1) = content.sha1() {
format!("commit {} {} ", sha1, msg.as_ref())
} else {
String::new()
}
}