#[non_exhaustive]pub struct RepoSnapshot {
pub head: Option<String>,
pub branch: Option<String>,
pub tracking: Option<UpstreamTracking>,
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 a
small fixed number of 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). On jj this is the nearest bookmark
reachable from @ (heads(::@ & bookmarks())), so it stays set across a
jj describe/jj new/jj commit; None when detached / no bookmark on
or above @. Matches Repo::current_branch
by construction.
tracking: Option<UpstreamTracking>Upstream tracking and how far the branch is ahead/behind it, as one unit —
Some only when an upstream is configured, None otherwise (and always
None on jj, which has no git-style upstream tracking). Bundling the
three together makes the “all-or-nothing” relationship unrepresentable as a
half-populated state. See UpstreamTracking.
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 ==.