pub struct GitOperations;
Expand description
Core git operations abstraction
Implementations§
Source§impl GitOperations
impl GitOperations
Sourcepub fn run_status(args: &[&str]) -> Result<()>
pub fn run_status(args: &[&str]) -> Result<()>
Execute a git command and return success status
Sourcepub fn current_branch() -> Result<String>
pub fn current_branch() -> Result<String>
Get current branch name
Sourcepub fn commit_exists(commit: &str) -> Result<bool>
pub fn commit_exists(commit: &str) -> Result<bool>
Check if a commit exists
Sourcepub fn short_hash(commit: &str) -> Result<String>
pub fn short_hash(commit: &str) -> Result<String>
Get short commit hash
Sourcepub fn upstream_branch() -> Result<String>
pub fn upstream_branch() -> Result<String>
Get upstream branch for current branch
Sourcepub fn ahead_behind_counts() -> Result<(u32, u32)>
pub fn ahead_behind_counts() -> Result<(u32, u32)>
Get ahead/behind counts compared to upstream
Sourcepub fn branch_info_optimized() -> Result<(String, Option<String>, u32, u32)>
pub fn branch_info_optimized() -> Result<(String, Option<String>, u32, u32)>
Get branch information in an optimized way to reduce git calls
Sourcepub fn local_branches() -> Result<Vec<String>>
pub fn local_branches() -> Result<Vec<String>>
Get all local branches
Sourcepub fn recent_branches(limit: Option<usize>) -> Result<Vec<String>>
pub fn recent_branches(limit: Option<usize>) -> Result<Vec<String>>
Get recent branches sorted by commit date
Sourcepub fn merged_branches() -> Result<Vec<String>>
pub fn merged_branches() -> Result<Vec<String>>
Get merged branches
Sourcepub fn is_working_directory_clean() -> Result<bool>
pub fn is_working_directory_clean() -> Result<bool>
Check if working directory is clean
Sourcepub fn staged_files() -> Result<Vec<String>>
pub fn staged_files() -> Result<Vec<String>>
Get staged files
Auto Trait Implementations§
impl Freeze for GitOperations
impl RefUnwindSafe for GitOperations
impl Send for GitOperations
impl Sync for GitOperations
impl Unpin for GitOperations
impl UnwindSafe for GitOperations
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more