#[non_exhaustive]pub struct RepoSnapshot {
pub head: Option<String>,
pub branch: Option<String>,
pub upstream: Option<String>,
pub ahead: Option<usize>,
pub behind: Option<usize>,
pub dirty: bool,
pub change_count: usize,
pub conflicted: bool,
pub operation: OperationState,
}Expand description
A one-shot snapshot of the common repository state — branch, upstream
tracking, ahead/behind, dirtiness, and operation state — gathered in one or
two process spawns instead of a call per field. The data a prompt, status
line, or TUI refresh needs. See Repo::snapshot.
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 working-copy commit’s full object id (git HEAD oid / jj @
commit id) on both backends; None on an unborn git repo. Truncate for
display.
branch: Option<String>Current branch (git) / bookmark (jj); None when detached or unset.
upstream: Option<String>Upstream tracking branch; None when unset, and always None on jj
(jj has no git-style upstream tracking).
ahead: Option<usize>Commits ahead of the upstream; None with no upstream (always on jj).
behind: Option<usize>Commits behind the upstream; None with no upstream (always on jj).
dirty: boolWhether the working copy has any uncommitted change (tracked or untracked).
change_count: usizeNumber of changed paths (tracked + untracked on git; the @ change’s
files on jj).
conflicted: boolWhether the working copy has an unresolved conflict.
operation: OperationStateIn-progress operation / conflict state (see OperationState).
Trait Implementations§
Source§impl Clone for RepoSnapshot
impl Clone for RepoSnapshot
Source§fn clone(&self) -> RepoSnapshot
fn clone(&self) -> RepoSnapshot
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 RepoSnapshot
impl Debug for RepoSnapshot
impl Eq for RepoSnapshot
Source§impl PartialEq for RepoSnapshot
impl PartialEq for RepoSnapshot
Source§fn eq(&self, other: &RepoSnapshot) -> bool
fn eq(&self, other: &RepoSnapshot) -> bool
self and other values to be equal, and is used by ==.