2024-05-14 16:28:17 +01:00
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)]
|
|
|
|
#[display("{}", sha)]
|
2024-05-11 19:46:20 +01:00
|
|
|
pub struct Commit {
|
|
|
|
sha: Sha,
|
|
|
|
message: Message,
|
|
|
|
}
|
|
|
|
impl Commit {
|
|
|
|
pub fn new(sha: &str, message: &str) -> Self {
|
|
|
|
Self {
|
|
|
|
sha: Sha::new(sha.to_string()),
|
|
|
|
message: Message::new(message.to_string()),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pub const fn sha(&self) -> &Sha {
|
|
|
|
&self.sha
|
|
|
|
}
|
|
|
|
pub const fn message(&self) -> &Message {
|
|
|
|
&self.message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-14 16:28:17 +01:00
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)]
|
2024-05-11 19:46:20 +01:00
|
|
|
pub struct Sha(String);
|
|
|
|
impl Sha {
|
|
|
|
pub const fn new(value: String) -> Self {
|
|
|
|
Self(value)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-14 16:28:17 +01:00
|
|
|
#[derive(Clone, Debug, PartialEq, Eq, derive_more::Display)]
|
2024-05-11 19:46:20 +01:00
|
|
|
pub struct Message(String);
|
|
|
|
impl Message {
|
|
|
|
pub const fn new(value: String) -> Self {
|
|
|
|
Self(value)
|
|
|
|
}
|
|
|
|
}
|