pub struct IndexSelection<'selection> {
pub mode: TransactionMode,
pub pathspecs: &'selection [String],
pub pathspec_file: Option<&'selection Path>,
pub pathspec_file_nul: bool,
pub stage_into_index: bool,
pub stage_tracked_changes: bool,
pub base_revision: &'selection str,
}Expand description
What:
The choices that shape one private index.
Why:
The incumbent’s initializeCommitIndex takes these as one object,
and the selection modes differ only in these values.
In TS you’d write (pseudocode):
initializeCommitIndex({ mode, pathspecs, pathspecFile, pathspecFileNul, stageIntoIndex, stageTrackedChanges, baseRevision });Fields§
§mode: TransactionModeCommit selection mode.
pathspecs: &'selection [String]Positional pathspecs of the command.
pathspec_file: Option<&'selection Path>Materialized pathspec file, when the command names one.
pathspec_file_nul: boolWhether the pathspec file separates records with NUL.
stage_into_index: boolWhether an index commit stages the selected worktree content into its copy.
stage_tracked_changes: boolWhether an index commit stages every tracked change, as commit -a does.
base_revision: &'selection strRecorded base commit, or the empty tree for an unborn base.
Trait Implementations§
Source§impl<'selection> Clone for IndexSelection<'selection>
impl<'selection> Clone for IndexSelection<'selection>
impl<'selection> Copy for IndexSelection<'selection>
Auto Trait Implementations§
impl<'selection> Freeze for IndexSelection<'selection>
impl<'selection> RefUnwindSafe for IndexSelection<'selection>
impl<'selection> Send for IndexSelection<'selection>
impl<'selection> Sync for IndexSelection<'selection>
impl<'selection> Unpin for IndexSelection<'selection>
impl<'selection> UnsafeUnpin for IndexSelection<'selection>
impl<'selection> UnwindSafe for IndexSelection<'selection>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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