pre-commit/tests/commands
Wade Carpenter feb0d34213
pre-push: fix stdin line splitting when <local ref> has whitespace
From the `pre-push.sample` file:

> Information about the commits which are being pushed is supplied as
> lines to the standard input in the form:
>
>   <local ref> <local sha1> <remote ref> <remote sha1>

When `<local ref>` is not simply a branch name, but a more general
ref (see git-rev-parse(1)), it could contain whitespace, and that
breaks the split() call that expected only 3 spaces in the line.

Changed to use `rsplit(maxsplit=3)` since only the <local ref> is
likely to have embedded whitespace.

Added a new test case for the same.
2022-04-14 14:27:46 -07:00
..
__init__.py Move commands into their own files. 2014-06-13 19:52:14 -07:00
autoupdate_test.py Pick a tag if multiple tags exist on a SHA. 2022-03-31 10:37:51 -04:00
clean_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
gc_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
hook_impl_test.py pre-push: fix stdin line splitting when <local ref> has whitespace 2022-04-14 14:27:46 -07:00
init_templatedir_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
install_uninstall_test.py implement default_install_hook_types 2022-04-02 15:11:31 -04:00
migrate_config_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
run_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
sample_config_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
try_repo_test.py drop python 3.6 support 2022-01-18 18:44:20 -05:00