git-next/crates/git/src/git_ref.rs
Paul Campbell ab728c7364
All checks were successful
Rust / build (push) Successful in 2m54s
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
refactor: merge config crate into core crate
2024-07-25 21:08:16 +01:00

18 lines
381 B
Rust

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