git_next_core/git/
git_ref.rs

1//
2use crate::{newtype, s};
3
4use derive_more::Display;
5
6use crate::git::{commit::Sha, Commit};
7
8newtype!(GitRef, String, Display, "A git reference to a git commit.");
9impl From<Commit> for GitRef {
10    fn from(value: Commit) -> Self {
11        Self(s!(value.sha()))
12    }
13}
14impl From<Sha> for GitRef {
15    fn from(value: Sha) -> Self {
16        Self(s!(value))
17    }
18}