Skip to main content

Module translate

Module translate 

Source
Expand description

mkit→git object translation (SPEC-GIT-BRIDGE §3–§8).

translate_closure walks the reachable closure of a root object bottom-up (children before parents, so a mirror is always connectivity-valid mid-write) and emits each translated git object exactly once through a caller-supplied sink. All per-object mappings are pure functions; the only state is the blake3→sha1 cache the caller threads through, and that cache is rebuildable by construction.

Structs§

TranslationBatch
Result of translating one closure: the root’s git id plus how many new objects were emitted (objects already in known are skipped).

Traits§

ObjectSource
Anything that can hand the translator deserialized mkit objects.

Functions§

git_mode
git mode string for an mkit tree-entry mode (§5).
git_type_of
The git type a translated mkit object carries (§7.1).
translate_blob
§3: blob body is the data, verbatim.
translate_chunked
§4: flatten a content-defined chunked blob.
translate_closure
Translate the reachable closure of root, emitting every newly translated object through sink in dependency order (children first). known is the blake3→sha1 cache; it is consulted to skip already-translated subgraphs and updated with every emission.
translate_commit
§6: commit with the pinned header layout.
translate_tag
§7: annotated/signed tag object.
translate_tree
§5: tree with entries re-sorted into git order.