mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
parent
0b6a39768a
commit
4f4767c9e0
2 changed files with 15 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue