pub enum CandidateRequest {
Add(Vec<OsString>),
Direct(Vec<OsString>),
Staged(Vec<OsString>),
StagedAtBase {
base: Option<ObjectId>,
pathspecs: Vec<OsString>,
},
Pushed(PushedScope),
Landed(ObjectId),
}Expand description
What:
What a lifecycle asks for.
An enum is a closed set of named alternatives;
each
carries the arguments it needs.
#[derive(...)] generates cloning,
debug
printing and ==.
Why:
The two sources differ only in what is staged on the private copy and in which
entries become candidates.
In TS you’d write (pseudocode):
type CandidateRequest = { kind: 'add'; region: string[] } | { kind: 'direct'; pathspecs: string[] };Variants§
Add(Vec<OsString>)
What git add with these arguments would stage.
Direct(Vec<OsString>)
The worktree files a direct command selects.
Staged(Vec<OsString>)
The entries the index already holds for the pathspecs, read without staging the worktree first. The commit path uses it, so corrections already written to the private index are the candidates.
StagedAtBase
The entries the private index holds for the pathspecs, with a recorded base commit (the empty tree when the
branch was unborn) as the baseline that marks additions, read without staging the worktree. The commit
transaction uses it: its baseline is the base it recorded at invocation, never the HEAD another landing may
have moved since. No pathspec means no candidate.
Fields
Pushed(PushedScope)
The changes a manual push publishes: each newly published commit’s own delta and the whole tree of each tip with no known published base.
Tuple Fields
0: PushedScopeThe commits and trees the scan reads.
Landed(ObjectId)
The paths one landed commit changed, each against every parent, as the post-commit gate reads them: the committed bytes and no worktree or index state.
Trait Implementations§
Source§impl Clone for CandidateRequest
impl Clone for CandidateRequest
Source§impl Debug for CandidateRequest
impl Debug for CandidateRequest
impl Eq for CandidateRequest
Source§impl PartialEq for CandidateRequest
impl PartialEq for CandidateRequest
impl StructuralPartialEq for CandidateRequest
Auto Trait Implementations§
impl Freeze for CandidateRequest
impl RefUnwindSafe for CandidateRequest
impl Send for CandidateRequest
impl Sync for CandidateRequest
impl Unpin for CandidateRequest
impl UnsafeUnpin for CandidateRequest
impl UnwindSafe for CandidateRequest
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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