Struct git2::Branch [−][src]
pub struct Branch<'repo> { /* fields omitted */ }
Expand description
A structure to represent a git branch
A branch is currently just a wrapper to an underlying Reference
. The
reference can be accessed through the get
and into_reference
methods.
Implementations
impl<'repo> Branch<'repo>
[src]
impl<'repo> Branch<'repo>
[src]pub fn get_mut(&mut self) -> &mut Reference<'repo>
[src]
pub fn get_mut(&mut self) -> &mut Reference<'repo>
[src]Gain mutable access to the reference that is this branch
pub fn into_reference(self) -> Reference<'repo>
[src]
pub fn into_reference(self) -> Reference<'repo>
[src]Take ownership of the underlying reference.
pub fn rename(
&mut self,
new_branch_name: &str,
force: bool
) -> Result<Branch<'repo>, Error>
[src]
pub fn rename(
&mut self,
new_branch_name: &str,
force: bool
) -> Result<Branch<'repo>, Error>
[src]Move/rename an existing local branch reference.
pub fn name(&self) -> Result<Option<&str>, Error>
[src]
pub fn name(&self) -> Result<Option<&str>, Error>
[src]Return the name of the given local or remote branch.
May return Ok(None)
if the name is not valid utf-8.
pub fn name_bytes(&self) -> Result<&[u8], Error>
[src]
pub fn name_bytes(&self) -> Result<&[u8], Error>
[src]Return the name of the given local or remote branch.