pre-commit/pre_commit
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
..
commands pre-push: fix stdin line splitting when <local ref> has whitespace 2022-04-14 14:27:46 -07:00
languages Handling multiple outputs from dotnet pack 2022-04-07 13:16:56 -04:00
meta_hooks drop python 3.6 support 2022-01-18 18:44:20 -05:00
resources fix python 2.7 repo: local hooks 2022-04-02 21:19:13 -04:00
__init__.py Initial commit. 2014-03-12 20:25:19 -07:00
__main__.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
clientlib.py implement default_install_hook_types 2022-04-02 15:11:31 -04:00
color.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
constants.py implement default_install_hook_types 2022-04-02 15:11:31 -04:00
envcontext.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
error_handler.py convince mypy that these are the same 2022-03-14 18:37:07 -04:00
errors.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
file_lock.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
git.py Split get_git_dir() into get_git_dir() and get_git_common_dir() 2022-04-02 15:07:22 -04:00
hook.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
logging_handler.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
main.py implement default_install_hook_types 2022-04-02 15:11:31 -04:00
output.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
parse_shebang.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
prefix.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
repository.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
staged_files_only.py move patch discarding inside try for staged_files_only 2022-04-02 16:24:57 -04:00
store.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
util.py drop python 3.6 support 2022-01-18 18:44:20 -05:00
xargs.py drop python 3.6 support 2022-01-18 18:44:20 -05:00