1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Files
prek/crates
Sadjow Leão dc98c4792d Honor repo and worktree core.hooksPath (#1892)
## Summary

This takes a smaller approach than #1673.

Instead of mutating Git config during install, it lets `prek` ask Git
for the effective hooks directory and:

- honors repo-local (`git config --local`) `core.hooksPath`
- honors worktree-local (`git config --worktree`) `core.hooksPath`
- continues to refuse global/system `core.hooksPath` by default
- aligns `prek uninstall` with the same behavior
- updates the CLI reference and FAQ to document the behavior

This keeps the existing safety boundary for externally configured hook
locations while making linked worktrees and repo-owned hook directories
work without extra wrapper logic.

## Testing

- `cargo test -p prek --test install`
- `PREK_GENERATE=1 cargo test --bin prek
cli::_gen::generate_cli_reference -- --exact`

## Context

Closes #1672
Closes #1673

---------

Co-authored-by: Jo <10510431+j178@users.noreply.github.com>
2026-04-13 17:11:44 +08:00
..
2026-03-04 18:46:19 +08:00