/// List all branches and the ID of the last commit of that branch.
List all branches and the ID of the last commit of that branch.
List all branches and the ID of the last commit of that branch .
pub fn list_branches_with_newest_commit_id(&self) -> Result<Vec<NameWithId>, Error> {
        let branches = self.repo.branches(Some(git2::BranchType::Local))?;
        let mut result = Vec::new();
        for branch in branches {
            let branch = branch?.0;
            if let (Some(name), Some(oid)) = (branch.name()?, branch.get().target()) {
                result.push(NameWithId {
                    commit_id: oid.to_string(),
                    name: name.to_owned(),
                });
            }
        }
        Ok(result)
    }
pub fn list_branches_with_newest_commit_id ( & self ) -> Result < Vec < NameWithId > , Error > { let branches = self . repo . branches ( Some ( git2 :: BranchType :: Local ) ) ? ; let mut result = Vec :: new ( ) ; for branch in branches { let branch = branch ? . 0 ; if let ( Some ( name ) , Some ( oid ) ) = ( branch . name ( ) ? , branch . get ( ) . target ( ) ) { result . push ( NameWithId { commit_id : oid . to_string ( ) , name : name . to_owned ( ) , } ) ; } } Ok ( result ) }
List all branches and the ID of the last commit of that branch.
List all branches and the ID of the last commit of that branch .
&self