pub struct Git;Implementations§
Source§impl Git
impl Git
pub fn is_inside_work_tree() -> bool
pub fn ensure_repo() -> Result<()>
Sourcepub fn add_files(files: &[String]) -> Result<()>
pub fn add_files(files: &[String]) -> Result<()>
Stage specific files, or everything (git add .) when empty.
pub fn add_all_changes() -> Result<()>
Sourcepub fn has_unstaged_changes() -> Result<bool>
pub fn has_unstaged_changes() -> Result<bool>
True when there are unstaged or untracked changes.
Uses git status --porcelain so untracked files count
(plain git diff --quiet misses them).
pub fn has_staged_changes() -> Result<bool>
pub fn get_staged_stat() -> Result<String>
Sourcepub fn get_staged_diff_raw() -> Result<String>
pub fn get_staged_diff_raw() -> Result<String>
Raw staged diff (git diff --cached).
pub fn get_staged_diff() -> Result<String>
pub fn commit(subject: &str, body: Option<&str>) -> Result<()>
pub fn push(branch: Option<&str>) -> Result<()>
pub fn get_current_branch() -> Result<String>
Auto Trait Implementations§
impl Freeze for Git
impl RefUnwindSafe for Git
impl Send for Git
impl Sync for Git
impl Unpin for Git
impl UnsafeUnpin for Git
impl UnwindSafe for Git
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