diff --git a/hermes_cli/post_update.py b/hermes_cli/post_update.py index 16357da4f5..0fba70a6f8 100644 --- a/hermes_cli/post_update.py +++ b/hermes_cli/post_update.py @@ -206,18 +206,18 @@ def step_adopt_blessed_checkout(project_root: Path | None = None) -> dict: if not is_blessed: return {"ok": True, "skipped": "not-a-blessed-root"} - try: - from hermes_cli.source_stamp import write_source_stamp + from hermes_cli.source_stamp import write_source_stamp + try: # Full checkout identity when git can answer; the birth-certificate # minimum below only when it cannot (or the tree is read-only). - write_source_stamp(root) + identified = write_source_stamp(root) except OSError as exc: # A read-only tree (nix-like layouts without their own stamp) # must not crash the boot — it just stays unadopted. logger.debug("blessed-checkout adoption skipped (unwritable): %s", exc) return {"ok": True, "skipped": f"unwritable: {exc}"} - except RuntimeError: + if identified is None: # No derivable git identity: write the minimal birth certificate. stamp = { "schemaVersion": 2,