#[non_exhaustive]pub struct BranchStatus {
pub head: Option<String>,
pub branch: Option<String>,
pub upstream: Option<String>,
pub ahead: Option<usize>,
pub behind: Option<usize>,
pub tracked_changes: usize,
pub untracked: usize,
pub conflicts: usize,
}Expand description
A combined branch + working-tree snapshot from git status --porcelain=v2 --branch -z: HEAD, branch, upstream tracking, ahead/behind, and change
counts — everything a prompt/status-bar needs, in one process spawn.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.head: Option<String>The HEAD commit’s full object id (# branch.oid); None on an unborn
repo (git reports (initial)). Truncate for display.
branch: Option<String>Current branch name (# branch.head); None when detached.
upstream: Option<String>Upstream tracking branch (# branch.upstream); None when unset.
ahead: Option<usize>Commits ahead of the upstream (# branch.ab +A); None when no upstream.
behind: Option<usize>Commits behind the upstream (# branch.ab -B); None when no upstream.
tracked_changes: usizeCount of changed tracked entries — modified/added/deleted/renamed/copied
and unmerged (the 1/2/u records).
untracked: usizeCount of untracked files (the ? records).
conflicts: usizeCount of unmerged (conflicted) entries (the u records; also in
tracked_changes).
Implementations§
Trait Implementations§
Source§impl Clone for BranchStatus
impl Clone for BranchStatus
Source§fn clone(&self) -> BranchStatus
fn clone(&self) -> BranchStatus
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 BranchStatus
impl Debug for BranchStatus
Source§impl Default for BranchStatus
impl Default for BranchStatus
Source§fn default() -> BranchStatus
fn default() -> BranchStatus
impl Eq for BranchStatus
Source§impl PartialEq for BranchStatus
impl PartialEq for BranchStatus
Source§fn eq(&self, other: &BranchStatus) -> bool
fn eq(&self, other: &BranchStatus) -> bool
self and other values to be equal, and is used by ==.