mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 00:04:42 +04:00
Merge pull request #2323 from pre-commit/move-try-slightly
move patch discarding inside `try` for staged_files_only
This commit is contained in:
commit
3aa2ce89e8
1 changed files with 1 additions and 1 deletions
|
|
@ -66,9 +66,9 @@ def _unstaged_changes_cleared(patch_dir: str) -> Generator[None, None, None]:
|
|||
|
||||
# prevent recursive post-checkout hooks (#1418)
|
||||
no_checkout_env = dict(os.environ, _PRE_COMMIT_SKIP_POST_CHECKOUT='1')
|
||||
cmd_output_b(*_CHECKOUT_CMD, env=no_checkout_env)
|
||||
|
||||
try:
|
||||
cmd_output_b(*_CHECKOUT_CMD, env=no_checkout_env)
|
||||
yield
|
||||
finally:
|
||||
# Try to apply the patch we saved
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue