feat: extract canonical ref-reading primitives into muse/core/refs.py
Add read_ref(path) -> str | None and iter_branch_refs(repo_root) -> Iterator[tuple[str, str]] as the canonical primitives for all ref-file I/O in Muse, following the same TDD approach used for object_store.py and graph.py.
- muse/core/refs.py: new module with read_ref and iter_branch_refs - tests/test_core_refs.py: 19 tests covering both primitives - muse/core/store.py: get_head_commit_id, get_all_branch_heads, _resolve_branch_commit_id, and resolve_commit_ref delegate to read_ref / iter_branch_refs - 21 command files and 3 core files updated to use the primitives instead of raw .read_text().strip() patterns - show_ref and for_each_ref gain hierarchical branch support (rglob) since iter_branch_refs uses rglob internally - doc_history and doc_extractor replace manual HEAD parsing with read_current_branch() from store.py
0 comments
muse hub commit comment sha256:33363e54e38fc57024a3873f2f4c13db6e994b7947480ccf905cba4a8588f4d5 --body "your comment"
No comments yet. Be the first to start the discussion.