mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Fix filenames with spaces in them.
This commit is contained in:
parent
061ac81682
commit
2ec7a34035
8 changed files with 25 additions and 7 deletions
|
|
@ -16,7 +16,7 @@ def run_hook(repo_cmd_runner, hook, file_args):
|
|||
# For PCRE the entry is the regular expression to match
|
||||
return repo_cmd_runner.run(
|
||||
[
|
||||
'xargs', 'sh', '-c',
|
||||
'xargs', '-0', 'sh', '-c',
|
||||
# Grep usually returns 0 for matches, and nonzero for non-matches
|
||||
# so we flip it here.
|
||||
'! grep -H -n -P {0} $@'.format(shell_escape(hook['entry'])),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue