2024-06-09 10:21:09 +01:00
|
|
|
//
|
|
|
|
use crate as git;
|
2024-06-20 19:03:11 +01:00
|
|
|
use derive_more::Display;
|
|
|
|
use git_next_config::newtype;
|
2024-06-09 10:21:09 +01:00
|
|
|
|
2024-05-11 19:46:20 +01:00
|
|
|
use crate::Commit;
|
|
|
|
|
2024-06-20 19:03:11 +01:00
|
|
|
newtype!(GitRef is a String, Display);
|
2024-05-11 19:46:20 +01:00
|
|
|
impl From<Commit> for GitRef {
|
|
|
|
fn from(value: Commit) -> Self {
|
|
|
|
Self(value.sha().to_string())
|
|
|
|
}
|
|
|
|
}
|
2024-06-09 10:21:09 +01:00
|
|
|
impl From<git::commit::Sha> for GitRef {
|
|
|
|
fn from(value: git::commit::Sha) -> Self {
|
|
|
|
Self(value.to_string())
|
|
|
|
}
|
|
|
|
}
|