0.0.2-alpha.4
This commit is contained in:
18
crates/knowledge-git-api/src/reference.rs
Normal file
18
crates/knowledge-git-api/src/reference.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
// file: crates/knowledge-git-api/src/reference.rs
|
||||
// version: 1
|
||||
|
||||
/// Opaque Git reference requested by a caller, such as a branch, tag or object expression.
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
pub struct GitReference(String);
|
||||
|
||||
impl crate::GitReference {
|
||||
/// Create an opaque Git reference without imposing one provider's reference grammar.
|
||||
pub fn new(value: &str) -> crate::GitReference {
|
||||
return crate::GitReference(value.to_owned());
|
||||
}
|
||||
|
||||
/// Return the reference text.
|
||||
pub fn as_str(&self) -> &str {
|
||||
return self.0.as_str();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user