mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-01-14 04:50:20 -06:00
@@ -224,7 +224,14 @@ def _run_hooks(config, hooks, args, environ):
|
||||
'`pre-commit install`.',
|
||||
)
|
||||
output.write_line('All changes made by hooks:')
|
||||
subprocess.call(('git', '--no-pager', 'diff', '--no-ext-diff'))
|
||||
if args.color:
|
||||
subprocess.call((
|
||||
'git', '--no-pager', 'diff', '--no-ext-diff',
|
||||
'--color={}'.format(args.color),
|
||||
))
|
||||
else:
|
||||
subprocess.call(('git', '--no-pager', 'diff', '--no-ext-diff'))
|
||||
|
||||
return retval
|
||||
|
||||
|
||||
|
||||
@@ -187,6 +187,13 @@ def test_global_exclude(cap_out, store, tempdir_factory):
|
||||
},
|
||||
b'All changes made by hooks:',
|
||||
),
|
||||
(
|
||||
{
|
||||
'show_diff_on_failure': True,
|
||||
'color': 'auto',
|
||||
},
|
||||
b'All changes made by hooks:',
|
||||
),
|
||||
(
|
||||
{
|
||||
'show_diff_on_failure': True,
|
||||
|
||||
Reference in New Issue
Block a user