feat: implement muse ls-tree command with synthetic directory entries
- _build_tree_entries: synthesizes tree entries from flat manifest by detecting shared path prefixes; non-recursive collapses subdirs into synthetic 040000 tree nodes; recursive lists all blobs only - _synthetic_tree_id: deterministic SHA-256 of sorted (path, oid) pairs under a prefix — gives each synthetic tree a stable, content-addressed ID - _resolve_manifest: resolves HEAD, branch names (via .muse/refs/heads/), and commit IDs (prefix scan) to a manifest - Flags: -r/--recursive, -d/--dirs-only, -l/--long (with byte sizes), --name-only, --json, positional treeish (default HEAD) + path prefix - Text format: '<mode> <type> <object_id>TAB<path>' - JSON schema: treeish + commit_id + entries array - 31 tests: unit helpers, integration (all flag combos, refs, formats), security (path traversal + ANSI rejection), stress (500-file repo)
0 comments
muse hub commit comment sha256:2844e173ab1a7d49e0a962310ee2b5d27036143ded9767102735f9848a21a719 --body "your comment"
No comments yet. Be the first to start the discussion.