Skip to main content

Module refname

Module refname 

Source
Expand description

git-side ref-name legality on top of the mkit grammar (SPEC-GIT-BRIDGE §12.1).

mkit ref names (SPEC-REFS §3) are already restricted to [0-9A-Za-z._-] segments, no empty segments, no .lock suffix, and no segment starting with . (which also covers the exact ./.. segments). That leaves two residual git-illegal-but-mkit-legal shapes, checked here: a segment ending in ., and a segment containing .. anywhere. The leading-dot check below is kept as defense in depth for any future caller of check_git_legal on a string not already run through validate_ref_name. No escaping: illegal names are refused per-ref.

Functions§

check_git_legal
Check a full mkit ref name (e.g. refs/heads/main) for git-side legality. The input is assumed to already satisfy the mkit grammar; this only adds git’s extra rules.
check_tag_name
Tag-object names ride in the git tag header (§7.1): they must satisfy the mkit ref grammar’s byte set so the header line is well-formed, plus the git rules above.