git-next/crates/git/src/git_ref.rs
Paul Campbell 717cc8b0bc
Some checks failed
ci/woodpecker/push/tag-created Pipeline is pending
ci/woodpecker/push/cron-docker-builder Pipeline was successful
Rust / build (push) Has been cancelled
ci/woodpecker/push/push-next Pipeline was successful
refactor: update macro signatures and add documentation support
2024-06-29 18:26:19 +01:00

18 lines
411 B
Rust

//
use crate as git;
use derive_more::Display;
use git_next_config::newtype;
use crate::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<git::commit::Sha> for GitRef {
fn from(value: git::commit::Sha) -> Self {
Self(value.to_string())
}
}