|
14 | 14 | from pre_commit.parse_shebang import find_executable |
15 | 15 | from pre_commit.util import cmd_output |
16 | 16 | from pre_commit.util import make_executable |
17 | | -from pre_commit.util import mkdirp |
18 | 17 | from pre_commit.util import resource_text |
19 | 18 | from testing.fixtures import git_dir |
20 | 19 | from testing.fixtures import make_consuming_repo |
@@ -307,7 +306,7 @@ def test_failing_hooks_returns_nonzero(tempdir_factory, store): |
307 | 306 |
|
308 | 307 |
|
309 | 308 | def _write_legacy_hook(path): |
310 | | - mkdirp(os.path.join(path, '.git/hooks')) |
| 309 | + os.makedirs(os.path.join(path, '.git/hooks'), exist_ok=True) |
311 | 310 | with open(os.path.join(path, '.git/hooks/pre-commit'), 'w') as f: |
312 | 311 | f.write('#!/usr/bin/env bash\necho "legacy hook"\n') |
313 | 312 | make_executable(f.name) |
@@ -370,7 +369,7 @@ def test_failing_existing_hook_returns_1(tempdir_factory, store): |
370 | 369 | path = make_consuming_repo(tempdir_factory, 'script_hooks_repo') |
371 | 370 | with cwd(path): |
372 | 371 | # Write out a failing "old" hook |
373 | | - mkdirp(os.path.join(path, '.git/hooks')) |
| 372 | + os.makedirs(os.path.join(path, '.git/hooks'), exist_ok=True) |
374 | 373 | with open(os.path.join(path, '.git/hooks/pre-commit'), 'w') as f: |
375 | 374 | f.write('#!/usr/bin/env bash\necho "fail!"\nexit 1\n') |
376 | 375 | make_executable(f.name) |
@@ -432,7 +431,7 @@ def test_replace_old_commit_script(tempdir_factory, store): |
432 | 431 | CURRENT_HASH, PRIOR_HASHES[-1], |
433 | 432 | ) |
434 | 433 |
|
435 | | - mkdirp(os.path.join(path, '.git/hooks')) |
| 434 | + os.makedirs(os.path.join(path, '.git/hooks'), exist_ok=True) |
436 | 435 | with open(os.path.join(path, '.git/hooks/pre-commit'), 'w') as f: |
437 | 436 | f.write(new_contents) |
438 | 437 | make_executable(f.name) |
@@ -609,7 +608,7 @@ def test_pre_push_legacy(tempdir_factory, store): |
609 | 608 | path = tempdir_factory.get() |
610 | 609 | cmd_output('git', 'clone', upstream, path) |
611 | 610 | with cwd(path): |
612 | | - mkdirp(os.path.join(path, '.git/hooks')) |
| 611 | + os.makedirs(os.path.join(path, '.git/hooks'), exist_ok=True) |
613 | 612 | with open(os.path.join(path, '.git/hooks/pre-push'), 'w') as f: |
614 | 613 | f.write( |
615 | 614 | '#!/usr/bin/env bash\n' |
@@ -658,7 +657,7 @@ def test_commit_msg_integration_passing( |
658 | 657 |
|
659 | 658 | def test_commit_msg_legacy(commit_msg_repo, tempdir_factory, store): |
660 | 659 | hook_path = os.path.join(commit_msg_repo, '.git/hooks/commit-msg') |
661 | | - mkdirp(os.path.dirname(hook_path)) |
| 660 | + os.makedirs(os.path.dirname(hook_path), exist_ok=True) |
662 | 661 | with open(hook_path, 'w') as hook_file: |
663 | 662 | hook_file.write( |
664 | 663 | '#!/usr/bin/env bash\n' |
@@ -713,7 +712,7 @@ def test_prepare_commit_msg_legacy( |
713 | 712 | hook_path = os.path.join( |
714 | 713 | prepare_commit_msg_repo, '.git/hooks/prepare-commit-msg', |
715 | 714 | ) |
716 | | - mkdirp(os.path.dirname(hook_path)) |
| 715 | + os.makedirs(os.path.dirname(hook_path), exist_ok=True) |
717 | 716 | with open(hook_path, 'w') as hook_file: |
718 | 717 | hook_file.write( |
719 | 718 | '#!/usr/bin/env bash\n' |
|
0 commit comments