mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-18 00:24:47 +04:00
Allow global core.hooksPath via --allow-global-hooks
This commit is contained in:
parent
e2c6a822c7
commit
f67f64306b
2 changed files with 14 additions and 1 deletions
|
|
@ -118,9 +118,14 @@ def install(
|
|||
overwrite: bool = False,
|
||||
hooks: bool = False,
|
||||
skip_on_missing_config: bool = False,
|
||||
allow_global_hooks: bool = False,
|
||||
git_dir: str | None = None,
|
||||
) -> int:
|
||||
if git_dir is None and git.has_core_hookpaths_set():
|
||||
if (
|
||||
git_dir is None and
|
||||
git.has_core_hookpaths_set() and
|
||||
not allow_global_hooks
|
||||
):
|
||||
logger.error(
|
||||
'Cowardly refusing to install hooks with `core.hooksPath` set.\n'
|
||||
'hint: `git config --unset-all core.hooksPath`',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue