Fix filenames with spaces in them.

This commit is contained in:
Anthony Sottile 2014-06-20 10:20:02 -07:00
parent 061ac81682
commit 2ec7a34035
8 changed files with 25 additions and 7 deletions

View file

@ -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'])),