diff --git a/pre_commit/main.py b/pre_commit/main.py index 28c4f7147..0994067d4 100644 --- a/pre_commit/main.py +++ b/pre_commit/main.py @@ -25,6 +25,9 @@ # https://github.com/pre-commit/pre-commit/issues/300 # In git 2.6.3 (maybe others), git exports this while running pre-commit hooks os.environ.pop('GIT_WORK_TREE', None) +# Don't trigger msysgit's wacky shell interpolation +# For instance on cmd_output('echo', 'hi{1}') +os.environ['MSYS'] = 'noglob' def main(argv=None): diff --git a/tests/repository_test.py b/tests/repository_test.py index f26b62311..91e9ff3e6 100644 --- a/tests/repository_test.py +++ b/tests/repository_test.py @@ -187,11 +187,11 @@ def test_run_hook_with_curly_braced_arguments(tempdir_factory, store): tempdir_factory, store, 'arg_per_line_hooks_repo', 'arg-per-line', [], - b"arg: hi {1}\narg: I'm {a} problem\n", + b"arg: hi{1}\narg: I'm {a} problem\n", config_kwargs={ 'hooks': [{ 'id': 'arg-per-line', - 'args': ['hi {1}', "I'm {a} problem"], + 'args': ['hi{1}', "I'm {a} problem"], }] }, )