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§
Sourcefn get_main_branch(&self) -> Result<Branch<'_>>
fn get_main_branch(&self) -> Result<Branch<'_>>
Get the Branch
for the main branch for the repository.
Sourcefn get_main_branch_oid(&self) -> Result<NonZeroOid>
fn get_main_branch_oid(&self) -> Result<NonZeroOid>
Get the OID corresponding to the main branch.
Sourcefn get_branch_oid_to_names(
&self,
) -> Result<HashMap<NonZeroOid, HashSet<ReferenceName>>>
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.
Sourcefn get_references_snapshot(&self) -> Result<RepoReferencesSnapshot>
fn get_references_snapshot(&self) -> Result<RepoReferencesSnapshot>
Get the positions of references in the repository.
Sourcefn get_default_push_remote(&self) -> Result<Option<String>>
fn get_default_push_remote(&self) -> Result<Option<String>>
Get the default remote to push to for new branches in this repository.