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

19 lines
379 B
Rust
Raw Normal View History

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
use crate::Commit;
2024-06-20 19:03:11 +01:00
newtype!(GitRef is a String, Display);
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())
}
}