diff --git a/pre_commit/commands/run.py b/pre_commit/commands/run.py index 3c18dd56..a58e2747 100644 --- a/pre_commit/commands/run.py +++ b/pre_commit/commands/run.py @@ -224,13 +224,10 @@ def _run_hooks(config, hooks, args, environ): '`pre-commit install`.', ) output.write_line('All changes made by hooks:') - 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')) + subprocess.call(( + 'git', '--no-pager', 'diff', '--no-ext-diff', + '--color={}'.format(args.color), + )) return retval diff --git a/tests/commands/run_test.py b/tests/commands/run_test.py index b4548f6f..a6266fac 100644 --- a/tests/commands/run_test.py +++ b/tests/commands/run_test.py @@ -181,12 +181,6 @@ def test_global_exclude(cap_out, store, tempdir_factory): @pytest.mark.parametrize( ('args', 'expected_out'), [ - ( - { - 'show_diff_on_failure': True, - }, - b'All changes made by hooks:', - ), ( { 'show_diff_on_failure': True, @@ -198,6 +192,7 @@ def test_global_exclude(cap_out, store, tempdir_factory): { 'show_diff_on_failure': True, 'all_files': True, + 'color': 'auto', }, b'reproduce locally with: pre-commit run --all-files', ),