Skip to main content

RepoHooks

Enum RepoHooks 

Source
pub enum RepoHooks {
    Own(PathBuf),
    Redirected {
        to: PathBuf,
        own: PathBuf,
    },
    Nowhere,
}
Expand description

Where git dispatches hooks from, and whether that is this repository’s OWN hooks directory or somewhere core.hooksPath sent it.

This replaces a bare repo_hooks_dir() that returned only the dispatch path. --git-path hooks is still the right question — never --git-dir plus join("hooks"), because hooks are explicitly SHARED across worktrees while a linked worktree’s --git-dir is its own PRIVATE gitdir, so joining “hooks” onto it names a directory git never dispatches from. The addition is asking --git-common-dir alongside it, so the answer can be compared against the directory that would be ours.

The distinction did not exist and its absence was silent. --git-path hooks honours core.hooksPath, so in a repository running husky it answers .husky/_ — inside the repo, plausible, and wrong. install wrote four shims there, husky’s own prepare regenerated the directory on the next npm install, and the repository went back to having no checks with nothing to show for it. Every guarantee this tool makes was off in those repositories and the fleet reported them as merely “drifted”.

Variants§

§

Own(PathBuf)

<git-common-dir>/hooks. Git dispatches from here and it is ours to write.

§

Redirected

core.hooksPath points somewhere else. Another tool owns dispatch here, and writing to own would install shims git never runs.

Fields

§

Nowhere

Not in a repository, or git would not answer.

Trait Implementations§

Source§

impl Clone for RepoHooks

Source§

fn clone(&self) -> RepoHooks

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RepoHooks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RepoHooks

Source§

impl PartialEq for RepoHooks

Source§

fn eq(&self, other: &RepoHooks) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RepoHooks

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.