Allow args for pcre hook

This commit is contained in:
Thierry Deo 2015-11-17 22:15:30 +01:00
parent 8a43a65557
commit f0c198f1ad
3 changed files with 24 additions and 1 deletions

View file

@ -25,7 +25,9 @@ def run_hook(repo_cmd_runner, hook, file_args):
'xargs', '-0', 'sh', '-c',
# Grep usually returns 0 for matches, and nonzero for non-matches
# so we flip it here.
'! {0} {1} $@'.format(grep_command, shell_escape(hook['entry'])),
'! {0} {1} {2} $@'.format(
grep_command, ' '.join(hook['args']),
shell_escape(hook['entry'])),
'--',
],
stdin=file_args_to_stdin(file_args),