pub struct RefSpecRef<'a> { /* private fields */ }
Expand description
A refspec with references to the memory it was parsed from.
Implementations§
Source§impl<'a> RefSpecRef<'a>
impl<'a> RefSpecRef<'a>
Access
Sourcepub fn source(&self) -> Option<&BStr>
pub fn source(&self) -> Option<&BStr>
Return the left-hand side of the spec, typically the source. It takes many different forms so don’t rely on this being a ref name.
It’s not present in case of deletions.
Sourcepub fn destination(&self) -> Option<&BStr>
pub fn destination(&self) -> Option<&BStr>
Return the right-hand side of the spec, typically the destination. It takes many different forms so don’t rely on this being a ref name.
It’s not present in case of source-only specs.
Sourcepub fn remote(&self) -> Option<&BStr>
pub fn remote(&self) -> Option<&BStr>
Always returns the remote side, whose actual side in the refspec depends on how it was parsed.
Sourcepub fn local(&self) -> Option<&BStr>
pub fn local(&self) -> Option<&BStr>
Always returns the local side, whose actual side in the refspec depends on how it was parsed.
Sourcepub fn prefix(&self) -> Option<&BStr>
pub fn prefix(&self) -> Option<&BStr>
Derive the prefix from the source
side of this spec if this is a fetch spec,
or the destination
side if it is a push spec, if it is possible to do so without ambiguity.
This means it starts with refs/
. Note that it won’t contain more than two components, like refs/heads/
Sourcepub fn expand_prefixes(&self, out: &mut Vec<BString>)
pub fn expand_prefixes(&self, out: &mut Vec<BString>)
As opposed to prefix()
, if the latter is None
it will expand to all possible prefixes and place them in out
.
Note that only the source
side is considered.
Sourcepub fn instruction(&self) -> Instruction<'a>
pub fn instruction(&self) -> Instruction<'a>
Transform the state of the refspec into an instruction making clear what to do with it.
Source§impl RefSpecRef<'_>
impl RefSpecRef<'_>
Conversion
Trait Implementations§
Source§impl<'a> Clone for RefSpecRef<'a>
impl<'a> Clone for RefSpecRef<'a>
Source§fn clone(&self) -> RefSpecRef<'a>
fn clone(&self) -> RefSpecRef<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more