@@ -663,12 +663,7 @@ def test_stages(cap_out, store, repo_with_passing_hook):
663663 'language' : 'pygrep' ,
664664 'stages' : [stage ],
665665 }
666- for i , stage in enumerate (
667- (
668- 'commit' , 'push' , 'manual' , 'prepare-commit-msg' ,
669- 'commit-msg' ,
670- ), 1 ,
671- )
666+ for i , stage in enumerate (('commit' , 'push' , 'manual' ), 1 )
672667 ],
673668 }
674669 add_config_to_repo (repo_with_passing_hook , config )
@@ -686,8 +681,6 @@ def _run_for_stage(stage):
686681 assert _run_for_stage ('commit' ).startswith (b'hook 1...' )
687682 assert _run_for_stage ('push' ).startswith (b'hook 2...' )
688683 assert _run_for_stage ('manual' ).startswith (b'hook 3...' )
689- assert _run_for_stage ('prepare-commit-msg' ).startswith (b'hook 4...' )
690- assert _run_for_stage ('commit-msg' ).startswith (b'hook 5...' )
691684
692685
693686def test_commit_msg_hook (cap_out , store , commit_msg_repo ):
@@ -819,6 +812,16 @@ def test_error_with_unstaged_config(cap_out, store, modified_config_repo):
819812 assert ret == 1
820813
821814
815+ def test_commit_msg_missing_filename (cap_out , store , repo_with_passing_hook ):
816+ args = run_opts (hook_stage = 'commit-msg' )
817+ ret , printed = _do_run (cap_out , store , repo_with_passing_hook , args )
818+ assert ret == 1
819+ assert printed == (
820+ b'[ERROR] `--commit-msg-filename` is required for '
821+ b'`--hook-stage commit-msg`\n '
822+ )
823+
824+
822825@pytest .mark .parametrize (
823826 'opts' , (run_opts (all_files = True ), run_opts (files = [C .CONFIG_FILE ])),
824827)
0 commit comments