pub struct GitRepo { /* private fields */ }
Implementations§
Source§impl GitRepo
impl GitRepo
Sourcepub fn init_with_branch(path: &Path, branch_name: Option<&str>) -> Result<Self>
pub fn init_with_branch(path: &Path, branch_name: Option<&str>) -> Result<Self>
Initialize a new repository or open an existing one
pub fn create_branch( &self, branch_name: &str, from_commit: Option<Oid>, ) -> Result<()>
pub fn commit_all_changes(&self, message: &str) -> Result<bool>
Sourcepub fn get_branch_commits(&self, branch_name: &str) -> Result<Vec<Oid>>
pub fn get_branch_commits(&self, branch_name: &str) -> Result<Vec<Oid>>
Get all commits from a specific branch (oldest to newest)
Sourcepub fn get_all_branches(&self) -> Result<Vec<String>>
pub fn get_all_branches(&self) -> Result<Vec<String>>
Get all local branch names
Sourcepub fn branch_exists(&self, branch_name: &str) -> bool
pub fn branch_exists(&self, branch_name: &str) -> bool
Check if a branch with the given name exists
Sourcepub fn exists_and_has_commits(&self) -> bool
pub fn exists_and_has_commits(&self) -> bool
Check if the repository already exists and has commits
Auto Trait Implementations§
impl Freeze for GitRepo
impl RefUnwindSafe for GitRepo
impl Send for GitRepo
impl !Sync for GitRepo
impl Unpin for GitRepo
impl UnwindSafe for GitRepo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more