pre-commit/pre_commit/commands
Noah Pendleton 451e042835 Permit installing to core.hooksPath if within repo
### 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
2021-08-05 13:02:19 -04:00
..
__init__.py Move commands into their own files. 2014-06-13 19:52:14 -07:00
autoupdate.py fixed message if repo couldn't be updated due to missing hook(s) 2020-11-22 13:34:10 -08:00
clean.py Add types to pre-commit 2020-01-12 10:15:01 -08:00
gc.py Add types to pre-commit 2020-01-12 10:15:01 -08:00
hook_impl.py Expose local branch ref as an environment variable 2021-06-19 18:18:14 +02:00
init_templatedir.py add init-templatedir --no-allow-missing-config 2020-07-20 19:02:35 -07:00
install_uninstall.py Permit installing to core.hooksPath if within repo 2021-08-05 13:02:19 -04:00
migrate_config.py Merge pull request #1684 from pre-commit/migrate_config_less_work 2020-11-05 16:27:23 -08:00
run.py Expose local branch ref as an environment variable 2021-06-19 18:18:14 +02:00
sample_config.py Update pre-commit version in sample config 2020-09-27 14:54:42 -07:00
try_repo.py Replace aspy.yaml with sort_keys=False 2020-01-31 17:18:59 -08:00