pub fn current_branch(&self) -> Result<Option<Branch>, Error> {
        let head = self.repo.head()?;
        Ok(if let Some(target) = head.symbolic_target() {
            Some(self.browse_branch(target)?)
        } else {
            Some(Branch::new_by_reference(&self.repo, head)?)
        })
    }
/// Attempt to get the current branch. This will return `None` if the current git `HEAD` is detached.
Attempt to get the current branch. This will return `None` if the current git `HEAD` is detached.
Attempt to get the current branch . This will return ` None ` if the current git ` HEAD ` is detached .
pub fn current_branch(&self) -> Result<Option<Branch>, Error> {
        let head = self.repo.head()?;
        Ok(if let Some(target) = head.symbolic_target() {
            Some(self.browse_branch(target)?)
        } else {
            Some(Branch::new_by_reference(&self.repo, head)?)
        })
    }
pub fn current_branch ( & self ) -> Result < Option < Branch > , Error > { let head = self . repo . head ( ) ? ; Ok ( if let Some ( target ) = head . symbolic_target ( ) { Some ( self . browse_branch ( target ) ? ) } else { Some ( Branch :: new_by_reference ( & self . repo , head ) ? ) } ) }
Attempt to get the current branch.
Attempt to get the current branch .
&self
&self