Trait RepoExt

Source
pub trait RepoExt {
    // Required methods
    fn get_main_branch(&self) -> Result<Branch<'_>>;
    fn get_main_branch_oid(&self) -> Result<NonZeroOid>;
    fn get_branch_oid_to_names(
        &self,
    ) -> Result<HashMap<NonZeroOid, HashSet<ReferenceName>>>;
    fn get_references_snapshot(&self) -> Result<RepoReferencesSnapshot>;
    fn get_default_push_remote(&self) -> Result<Option<String>>;
}
Expand description

Helper functions on Repo.

Required Methods§

Source

fn get_main_branch(&self) -> Result<Branch<'_>>

Get the Branch for the main branch for the repository.

Source

fn get_main_branch_oid(&self) -> Result<NonZeroOid>

Get the OID corresponding to the main branch.

Source

fn get_branch_oid_to_names( &self, ) -> Result<HashMap<NonZeroOid, HashSet<ReferenceName>>>

Get a mapping from OID to the names of branches which point to that OID.

The returned branch names include the refs/heads/ prefix, so it must be stripped if desired.

Source

fn get_references_snapshot(&self) -> Result<RepoReferencesSnapshot>

Get the positions of references in the repository.

Source

fn get_default_push_remote(&self) -> Result<Option<String>>

Get the default remote to push to for new branches in this repository.

Implementors§