mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 01:51:46 +04:00
fix hooks firing during staged_files_only
This commit is contained in:
parent
0670e0b287
commit
928938a6a1
5 changed files with 53 additions and 5 deletions
|
|
@ -1022,3 +1022,9 @@ def test_args_hook_only(cap_out, store, repo_with_passing_hook):
|
|||
run_opts(hook='do_not_commit'),
|
||||
)
|
||||
assert b'identity-copy' not in printed
|
||||
|
||||
|
||||
def test_skipped_without_any_setup_for_post_checkout(in_git_dir, store):
|
||||
environ = {'_PRE_COMMIT_SKIP_POST_CHECKOUT': '1'}
|
||||
opts = run_opts(hook_stage='post-checkout')
|
||||
assert run(C.CONFIG_FILE, store, opts, environ=environ) == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue