git-next/crates/git/src/git_ref.rs
Paul Campbell 2cdaf39c0f
All checks were successful
Rust / build (push) Successful in 1m39s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
refactor: git: use newtype
2024-06-20 19:06:24 +01:00

18 lines
379 B
Rust

//
use crate as git;
use derive_more::Display;
use git_next_config::newtype;
use crate::Commit;
newtype!(GitRef is a String, Display);
impl From<Commit> for GitRef {
fn from(value: Commit) -> Self {
Self(value.sha().to_string())
}
}
impl From<git::commit::Sha> for GitRef {
fn from(value: git::commit::Sha) -> Self {
Self(value.to_string())
}
}