Expand description
Reversible UTF-8 names for portable, case-sensitive storage.
Constants§
- NAME_
PATH_ BUDGET - Maximum relative name path in bytes. With a 512-byte repository root,
.heddle/threads/(17), a 255-byte checkout leaf plus separator (256), and 111 bytes for checkout-local Heddle metadata, the absolute path is at most 1024 bytes. Two encoded names in remote refs also fit this budget.
Functions§
- decode_
name - Strict inverse; reject aliases and malformed/non-UTF-8 encodings.
- decode_
name_ path - Decode only canonical storage paths, including exact UTF-8 identity.
- encode_
name - Percent escaping shared by ref storage and managed checkouts. Uppercase
ASCII is escaped too: distinct names stay distinct on case-folding hosts.
The
n-prefix excludes Windows device names; dots and hostile bytes escape. - git_
name - Undo the reserved import mapping when projecting a native name back to Git.
- is_
digest_ name_ path - Recognize the complete digest path; never accept a digest prefix or alias.
- name_
path - Bounded components and a terminal directory keep even long names disjoint.
Each chunk is ASCII, at most 182 bytes;
entrycan never be another chunk. Long names use the full BLAKE3 digest of the exact native UTF-8 identity. Their entry must carry anamefile, verified by the filesystem reader. - native_
git_ name - Map Git names that collide with native reservation (or the escape prefix) into a distinct native identity. Signed source refs always keep their bytes.
- strip_
ref_ line_ ending - Remove only one LF or CRLF framing terminator, preserving name bytes.