Trait nicegit::RepositoryExt [−][src]
pub trait RepositoryExt { fn branch_names(&self, branch_type: Option<BranchType>) -> Vec<String>; fn local_branches(&self) -> HashMap<String, Branch>; fn ref_dwim_local(&self, name: &str) -> Option<Reference>; fn current_branch_name(&self) -> Option<String>; }
A set of extension methods for the Repository
type in git2.
Required Methods
fn branch_names(&self, branch_type: Option<BranchType>) -> Vec<String>
Gets a list of all branch names for the repository, with branch_type
letting you filter by
local, known remote, or all known branches.
fn local_branches(&self) -> HashMap<String, Branch>
Gets a mapping of all local branches to their actual branch objects.
fn ref_dwim_local(&self, name: &str) -> Option<Reference>
Do a "do what I mean" lookup on a refname - the 'fuzzy' sort you're used to from the CLI. In order of priority, this becomes:
- Symbolic names and commit hashes
- Named refs
- Tags by exact name
- The HEAD of a named branch You need to exactly match one of the above, or this search will fail.
fn current_branch_name(&self) -> Option<String>
Get the name of the currently checked out branch, if one is checked out.
Implementations on Foreign Types
impl RepositoryExt for Repository
[src]
impl RepositoryExt for Repository
fn branch_names(&self, branch_type: Option<BranchType>) -> Vec<String>
[src]
fn branch_names(&self, branch_type: Option<BranchType>) -> Vec<String>
fn local_branches(&self) -> HashMap<String, Branch>
[src]
fn local_branches(&self) -> HashMap<String, Branch>
fn ref_dwim_local(&self, name: &str) -> Option<Reference>
[src]
fn ref_dwim_local(&self, name: &str) -> Option<Reference>
fn current_branch_name(&self) -> Option<String>
[src]
fn current_branch_name(&self) -> Option<String>