summaryrefslogtreecommitdiffstats
path: root/pre_commit/staged_files_only.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:11 +0000
commit361ff4da262b4891323287049e9e6c5fbe1d01dc (patch)
tree969b376a2c170841758d39ef9516dac65c8b94cd /pre_commit/staged_files_only.py
parentAdding upstream version 2.17.0. (diff)
downloadpre-commit-361ff4da262b4891323287049e9e6c5fbe1d01dc.tar.xz
pre-commit-361ff4da262b4891323287049e9e6c5fbe1d01dc.zip
Adding upstream version 2.18.1.upstream/2.18.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/staged_files_only.py')
-rw-r--r--pre_commit/staged_files_only.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/pre_commit/staged_files_only.py b/pre_commit/staged_files_only.py
index bad004c..83d8a03 100644
--- a/pre_commit/staged_files_only.py
+++ b/pre_commit/staged_files_only.py
@@ -1,3 +1,5 @@
+from __future__ import annotations
+
import contextlib
import logging
import os.path
@@ -64,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