mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-16 02:21:46 +04:00
### Summary There's [several threads](https://github.com/pre-commit/pre-commit/issues?q=is%3Aissue+core+hooksPath+is%3Aclosed) around using pre-commit with global git hooks directories, but I didn't see anything around setting `core.hooksPath` to a directory within the repo, as the `husky` tool does. This patch adds support for installing/uninstalling pre-commit when `core.hooksPath` references a path within the git repo. ### Testing - add a couple of simple tests - a repo with core.hooksPath set within the repo, install/uninstall does the right thing - a repo with core.hooksPath set to `../hooks`, install/uninstall fails - a repo with core.hooksPath unset, install/uninstall works as before |
||
|---|---|---|
| .. | ||
| commands | ||
| languages | ||
| meta_hooks | ||
| resources | ||
| __init__.py | ||
| __main__.py | ||
| clientlib.py | ||
| color.py | ||
| constants.py | ||
| envcontext.py | ||
| error_handler.py | ||
| errors.py | ||
| file_lock.py | ||
| git.py | ||
| hook.py | ||
| logging_handler.py | ||
| main.py | ||
| output.py | ||
| parse_shebang.py | ||
| prefix.py | ||
| repository.py | ||
| staged_files_only.py | ||
| store.py | ||
| util.py | ||
| xargs.py | ||