Skip to content

The agent that grows with you

fix(update): a git fsmonitor daemon in the tree is not an index.lock holder

Teknium860078d116c8
diff --git a/hermes_cli/_early_recovery.py b/hermes_cli/_early_recovery.py
index 51c174d68ce..177dbbb5a0f 100644
--- a/hermes_cli/_early_recovery.py
+++ b/hermes_cli/_early_recovery.py
@@ -449,6 +449,9 @@ def _held_open(path: Path, root: Path | None = None) -> bool | None:
except OSError:
continue
if comm.startswith("git") and (cwd + os.sep).startswith(inside):
+ with contextlib.suppress(OSError): # the fsmonitor daemon lives in the tree but never locks the index
+ if b"fsmonitor--daemon" in (pid_dir / "cmdline").read_bytes():
+ continue
return True
return False
import shutil