pub struct Repository { /* private fields */ }
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn add_all(&self) -> Result<()>
pub fn add_all(&self) -> Result<()>
Add all changes to the staging area (equivalent to git add .
).
§Returns
A Result
indicating success or a GitError
if the operation fails.
Sourcepub fn add_update(&self) -> Result<()>
pub fn add_update(&self) -> Result<()>
Add all tracked files that have been modified (equivalent to git add -u
).
§Returns
A Result
indicating success or a GitError
if the operation fails.
Source§impl Repository
impl Repository
Source§impl Repository
impl Repository
Source§impl Repository
impl Repository
Sourcepub fn ensure_git() -> Result<()>
pub fn ensure_git() -> Result<()>
Ensure that Git is available in the system PATH.
This function checks if the git
command is available in the system PATH.
The result is cached, so subsequent calls are very fast.
If Git is not found, it returns a GitError::CommandFailed
with an appropriate error message.
§Returns
A Result
containing either Ok(())
if Git is available or a GitError
.
pub fn repo_path(&self) -> &Path
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repository
impl RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl UnwindSafe for Repository
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