git-next/crates/git/src/git_ref.rs
Paul Campbell 588666ffe1
All checks were successful
Rust / build (push) Successful in 2m22s
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
tests: add more tests to git crate
2024-06-13 19:50:19 +01:00

18 lines
421 B
Rust

//
use crate as git;
use derive_more::Constructor;
use crate::Commit;
#[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())
}
}
impl From<git::commit::Sha> for GitRef {
fn from(value: git::commit::Sha) -> Self {
Self(value.to_string())
}
}