pre-commit/tests/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_test.py add test to guard against yaml_dump 2020-11-06 17:07:37 -08:00
clean_test.py some manual py2 cleanups 2020-01-12 09:27:04 -08:00
gc_test.py Implement pre-commit autoupdate --freeze 2019-12-28 13:07:39 -08:00
hook_impl_test.py Add: post-merge hook support 2021-02-23 19:00:02 -08:00
init_templatedir_test.py add init-templatedir --no-allow-missing-config 2020-07-20 19:02:35 -07:00
install_uninstall_test.py Permit installing to core.hooksPath if within repo 2021-08-05 13:02:19 -04:00
migrate_config_test.py use textwrap.indent instead of _indent 2020-11-05 15:59:46 -08:00
run_test.py Expose local branch ref as an environment variable 2021-06-19 18:18:14 +02:00
sample_config_test.py Update pre-commit version in sample config 2020-09-27 14:54:42 -07:00
try_repo_test.py fix excess whitespace in traceback in error 2020-09-07 15:01:50 -07:00