Pass correct value to git color based on args.color

This commit is contained in:
Mandar Vaze 2019-06-01 17:33:27 +05:30
parent 64f0178b75
commit 3d7b374bef
2 changed files with 10 additions and 3 deletions

View file

@ -224,9 +224,11 @@ def _run_hooks(config, hooks, args, environ):
'`pre-commit install`.',
)
output.write_line('All changes made by hooks:')
# args.color is a boolean.
# See user_color function in color.py
subprocess.call((
'git', '--no-pager', 'diff', '--no-ext-diff',
'--color={}'.format(args.color),
'--color={}'.format({True: 'always', False: 'never'}[args.color]),
))
return retval