pub struct GitWorkingTree {
pub head: Option<String>,
pub branch: Option<String>,
pub detached: bool,
pub upstream: Option<String>,
pub ahead: Option<u32>,
pub behind: Option<u32>,
pub staged: u32,
pub modified: u32,
pub untracked: u32,
pub conflicted: u32,
pub clean: bool,
pub changed_paths: Vec<String>,
}Expand description
The state of one work tree, as porcelain v2 reports it.
Fields§
§head: Option<String>The commit HEAD names, or None in a repository with no commits yet.
branch: Option<String>The branch, or None when HEAD is detached or unborn.
detached: boolWhether HEAD names a commit directly rather than a branch.
upstream: Option<String>The upstream the branch tracks, when it tracks one.
ahead: Option<u32>Commits this branch has that its upstream does not; None without an upstream.
behind: Option<u32>Commits the upstream has that this branch does not; None without an upstream.
staged: u32Tracked files with staged changes.
modified: u32Tracked files changed in the work tree and not staged.
untracked: u32Files git does not track and is not ignoring.
conflicted: u32Files with an unresolved merge.
clean: boolWhether nothing at all is staged, modified, untracked or conflicted.
changed_paths: Vec<String>Every path that is not clean, repository-relative, in git’s order. Used to decide whether the cached tier is still valid, and shown to nobody.
Implementations§
Source§impl GitWorkingTree
impl GitWorkingTree
Sourcepub fn dirty_files(&self) -> u32
pub fn dirty_files(&self) -> u32
How many tracked files differ from HEAD, staged or not.
Trait Implementations§
Source§impl Clone for GitWorkingTree
impl Clone for GitWorkingTree
Source§fn clone(&self) -> GitWorkingTree
fn clone(&self) -> GitWorkingTree
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GitWorkingTree
impl Debug for GitWorkingTree
Source§impl<'de> Deserialize<'de> for GitWorkingTree
impl<'de> Deserialize<'de> for GitWorkingTree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for GitWorkingTree
Source§impl JsonSchema for GitWorkingTree
impl JsonSchema for GitWorkingTree
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for GitWorkingTree
impl PartialEq for GitWorkingTree
Source§fn eq(&self, other: &GitWorkingTree) -> bool
fn eq(&self, other: &GitWorkingTree) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for GitWorkingTree
impl Serialize for GitWorkingTree
impl StructuralPartialEq for GitWorkingTree
Auto Trait Implementations§
impl Freeze for GitWorkingTree
impl RefUnwindSafe for GitWorkingTree
impl Send for GitWorkingTree
impl Sync for GitWorkingTree
impl Unpin for GitWorkingTree
impl UnsafeUnpin for GitWorkingTree
impl UnwindSafe for GitWorkingTree
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.