2024-06-09 10:21:09 +01:00
|
|
|
//
|
2024-07-25 09:02:43 +01:00
|
|
|
use git_next_core::newtype;
|
|
|
|
|
2024-06-20 19:03:11 +01:00
|
|
|
use derive_more::Display;
|
2024-06-09 10:21:09 +01:00
|
|
|
|
2024-07-25 09:02:43 +01:00
|
|
|
use crate::{commit::Sha, Commit};
|
2024-05-11 19:46:20 +01:00
|
|
|
|
2024-06-29 14:56:20 +01:00
|
|
|
newtype!(GitRef: String, Display: "A git reference to a git commit.");
|
2024-05-11 19:46:20 +01:00
|
|
|
impl From<Commit> for GitRef {
|
|
|
|
fn from(value: Commit) -> Self {
|
|
|
|
Self(value.sha().to_string())
|
|
|
|
}
|
|
|
|
}
|
2024-07-25 09:02:43 +01:00
|
|
|
impl From<Sha> for GitRef {
|
|
|
|
fn from(value: Sha) -> Self {
|
2024-06-09 10:21:09 +01:00
|
|
|
Self(value.to_string())
|
|
|
|
}
|
|
|
|
}
|