-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Summary
When core.hooksPath points to a global/shared directory, mix compile (auto-install) or mix git_hooks.install writes hooks into that directory and overwrites existing hooks with project-specific scripts.
Repro
git config --global core.hooksPath ~/.config/git/hooks(or any shared path)- In a repo with
git_hooksauto-install enabled, runmix compile(ormix git_hooks.install) - Observe hooks written into
~/.config/git/hookswith the repoproject_pathhardcoded
Expected
If the resolved hooks path is outside the repo, refuse install by default (warn) unless explicitly opted in.
Actual
Hooks are installed into the external hooks directory and clobber existing global hooks.
Proposed fix
Before installing, check whether git rev-parse --git-path hooks resolves inside the repo root. If not, skip with a warning unless allow_external_hooks_path: true or GIT_HOOKS_ALLOW_EXTERNAL=1 is set.
Metadata
Metadata
Assignees
Labels
No labels