There was an error while loading. Please reload this page.
2 parents 92f433c + 1b93e26 commit 5e21e0bCopy full SHA for 5e21e0b
1 file changed
tests/commands/run_test.py
@@ -22,6 +22,7 @@
22
from pre_commit.util import make_executable
23
from testing.auto_namedtuple import auto_namedtuple
24
from testing.fixtures import add_config_to_repo
25
+from testing.fixtures import git_dir
26
from testing.fixtures import make_consuming_repo
27
from testing.fixtures import modify_config
28
from testing.fixtures import read_config
@@ -709,6 +710,27 @@ def test_commit_msg_hook(cap_out, store, commit_msg_repo):
709
710
)
711
712
713
+def test_post_checkout_hook(cap_out, store, tempdir_factory):
714
+ path = git_dir(tempdir_factory)
715
+ config = {
716
+ 'repo': 'meta', 'hooks': [
717
+ {'id': 'identity', 'stages': ['post-checkout']},
718
+ ],
719
+ }
720
+ add_config_to_repo(path, config)
721
+
722
+ with cwd(path):
723
+ _test_run(
724
+ cap_out,
725
+ store,
726
+ path,
727
+ {'hook_stage': 'post-checkout'},
728
+ expected_outputs=[b'identity...'],
729
+ expected_ret=0,
730
+ stage=False,
731
+ )
732
733
734
def test_prepare_commit_msg_hook(cap_out, store, prepare_commit_msg_repo):
735
filename = '.git/COMMIT_EDITMSG'
736
with open(filename, 'w') as f:
0 commit comments