pub struct HookChanges {
pub paths: Vec<String>,
pub worktree_records: Vec<AddedPath>,
}Expand description
What:
What a pre-commit hook staged beyond the tree it saw.
Why:
The landing guards these paths against a concurrent staging, and the worktree takes the committed bytes.
In TS you’d write (pseudocode):
type HookChanges = { paths: readonly string[]; worktreeRecords: readonly AddedPathRecord[] };Fields§
§paths: Vec<String>Every path whose entry differs between the tree the hook saw and the tree it left.
worktree_records: Vec<AddedPath>Modified ordinary files whose worktree copy receives the committed bytes while it holds the pre-hook bytes.
Implementations§
Source§impl HookChanges
impl HookChanges
Sourcepub fn combine(earlier: &HookChanges, later: &HookChanges) -> HookChanges
pub fn combine(earlier: &HookChanges, later: &HookChanges) -> HookChanges
What: Join the changes of successive preparations and revalidations. Why: A replay starts again from the prepared commit, so the union of paths and every completion stay.
In TS you’d write (pseudocode):
combineHookChanges({ earlier, later });Trait Implementations§
Source§impl Clone for HookChanges
impl Clone for HookChanges
Source§impl Debug for HookChanges
impl Debug for HookChanges
Source§impl Default for HookChanges
impl Default for HookChanges
impl Eq for HookChanges
Source§impl PartialEq for HookChanges
impl PartialEq for HookChanges
impl StructuralPartialEq for HookChanges
Auto Trait Implementations§
impl Freeze for HookChanges
impl RefUnwindSafe for HookChanges
impl Send for HookChanges
impl Sync for HookChanges
impl Unpin for HookChanges
impl UnsafeUnpin for HookChanges
impl UnwindSafe for HookChanges
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<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
Compare self to
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> ⓘ
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