Skip to content

Commit

Permalink
Try noglob
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Dec 7, 2015
1 parent ef20046 commit df91b9f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions pre_commit/main.py
Expand Up @@ -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):
Expand Down
4 changes: 2 additions & 2 deletions tests/repository_test.py
Expand Up @@ -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"],
}]
},
)
Expand Down

0 comments on commit df91b9f

Please sign in to comment.