From 9eb68e6200cae1b28ce60f01c341de6fdde5788f Mon Sep 17 00:00:00 2001 From: LenaWil Date: Thu, 18 May 2023 21:10:49 +0200 Subject: [PATCH] Work around a bug in fsmonitor daemon by stopping it --- pre_commit/staged_files_only.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pre_commit/staged_files_only.py b/pre_commit/staged_files_only.py index 88123565..456a51f4 100644 --- a/pre_commit/staged_files_only.py +++ b/pre_commit/staged_files_only.py @@ -49,6 +49,8 @@ def _intent_to_add_cleared() -> Generator[None, None, None]: @contextlib.contextmanager def _unstaged_changes_cleared(patch_dir: str) -> Generator[None, None, None]: + # Work around a bug in fsmonitor daemon by stopping it. + cmd_output('git', 'fsmonitor--daemon', 'stop') tree = cmd_output('git', 'write-tree')[1].strip() diff_cmd = ( 'git', 'diff-index', '--ignore-submodules', '--binary',