pub trait RepoExt {
fn get_main_branch_reference(&self) -> Result<Reference<'_>>;
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>;
}
Expand description
Helper functions on Repo
.
Required Methods
sourcefn get_main_branch_reference(&self) -> Result<Reference<'_>>
fn get_main_branch_reference(&self) -> Result<Reference<'_>>
Get the Reference
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.