git-next/crates/git/src/git_ref.rs

19 lines
421 B
Rust
Raw Normal View History

2024-06-09 10:21:09 +01:00
//
use crate as git;
use derive_more::Constructor;
use crate::Commit;
2024-06-09 10:21:09 +01:00
#[derive(Clone, Constructor, Debug, Hash, PartialEq, Eq, derive_more::Display)]
pub struct GitRef(String);
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())
}
}