Skip to content

Commit 3aa2ce8

Browse files
authored
Merge pull request #2323 from pre-commit/move-try-slightly
move patch discarding inside `try` for staged_files_only
2 parents 7602abc + a138c85 commit 3aa2ce8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pre_commit/staged_files_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ def _unstaged_changes_cleared(patch_dir: str) -> Generator[None, None, None]:
6666

6767
# prevent recursive post-checkout hooks (#1418)
6868
no_checkout_env = dict(os.environ, _PRE_COMMIT_SKIP_POST_CHECKOUT='1')
69-
cmd_output_b(*_CHECKOUT_CMD, env=no_checkout_env)
7069

7170
try:
71+
cmd_output_b(*_CHECKOUT_CMD, env=no_checkout_env)
7272
yield
7373
finally:
7474
# Try to apply the patch we saved

0 commit comments

Comments
 (0)