pub struct GitStatus {
pub modified: Vec<PathBuf>,
pub added: Vec<PathBuf>,
pub deleted: Vec<PathBuf>,
pub untracked: Vec<PathBuf>,
pub conflicts: Vec<PathBuf>,
pub renamed: Vec<(PathBuf, PathBuf)>,
pub branch: Option<String>,
pub in_merge: bool,
pub in_rebase: bool,
}Expand description
Git repository status
Fields§
§modified: Vec<PathBuf>Modified files (staged and unstaged)
added: Vec<PathBuf>Added files (staged)
deleted: Vec<PathBuf>Deleted files (staged and unstaged)
untracked: Vec<PathBuf>Untracked files
conflicts: Vec<PathBuf>Files with conflicts
renamed: Vec<(PathBuf, PathBuf)>Renamed files (old_path -> new_path)
branch: Option<String>Current branch name (None if detached HEAD)
in_merge: boolIs repository in merge state
in_rebase: boolIs repository in rebase state
Implementations§
Source§impl GitStatus
impl GitStatus
Sourcepub fn has_staged_changes(&self) -> bool
pub fn has_staged_changes(&self) -> bool
Check if there are staged changes
Sourcepub fn has_unstaged_changes(&self) -> bool
pub fn has_unstaged_changes(&self) -> bool
Check if there are unstaged changes
Sourcepub fn has_conflicts(&self) -> bool
pub fn has_conflicts(&self) -> bool
Check if there are conflicts
Sourcepub fn all_changed_files(&self) -> Vec<PathBuf>
pub fn all_changed_files(&self) -> Vec<PathBuf>
Get all changed files (staged and unstaged)
Trait Implementations§
impl StructuralPartialEq for GitStatus
Auto Trait Implementations§
impl Freeze for GitStatus
impl RefUnwindSafe for GitStatus
impl Send for GitStatus
impl Sync for GitStatus
impl Unpin for GitStatus
impl UnsafeUnpin for GitStatus
impl UnwindSafe for GitStatus
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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