fix: correct .muse init layout — bare repos, encoding, type safety, constants
Bugs fixed: - Bare repos no longer receive .museattributes or .museignore; those files belong to the working tree and are meaningless in a bare repository. - Every write_text / read_text call in init.py and the HEAD/ref/JSON paths of store.py now specifies encoding="utf-8", closing a latent corruption risk on non-UTF-8 locales (Windows, some Linux configs). Commit messages and author names are Unicode and must be written with an explicit codec. - --force repo-id recovery now guards the .get() result with isinstance(str) before assigning to existing_repo_id: str | None, removing an unguarded Any → str assignment.
Quality: - Five domain-block strings in _museignore_template were re-allocated on every muse init call and four were always discarded. Promoted to module-level constants (_MUSEIGNORE_DOMAIN_BLOCKS, _MUSEIGNORE_HEADER, _MUSEIGNORE_GLOBAL) so each string is interned once at import time. - Docstring updated: objects/ is created eagerly at init time, not lazily on first commit as the old text claimed.
No comments yet. Be the first to start the discussion.