18 lines
381 B
Rust
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())
|
|
}
|
|
}
|