sley-submodule — shared submodule engine for sley.
Centralizes two pieces of submodule logic that git keeps in
submodule-config.c and submodule.c, and that sley previously scattered
across the 1850-line submodule CLI command and ~14 ad-hoc .gitmodules
walks:
- [
config] — typed.gitmodulesparsing (submodule-config.c): a [config::SubmoduleConfigSet] of typed [config::Submodule] entries, plus thecheck_submodule_name/check_submodule_urlsecurity checks and the recurse-mode / update-strategy enums. - [
relative_url] — the.gitmodules-url → concrete-url resolution (remote.c::relative_url+submodule--helper.c::resolve_relative_url).submodule init/sync/addall route their relative-url math through this one primitive so every git URL form (ssh, scp-style, file://, helper, relative local path) resolves byte-for-byte the way upstream does. - [
update_strategy] — thesubmodule updatemode resolver (submodule--helper.c::determine_submodule_update_strategy): picks ONE of checkout/merge/rebase/command/none from the CLI-flag →.git/config→.gitmodules→ default-checkout precedence, with thejust_cloneddowngrade.submodule updateroutes every mode through this one resolver. - [
move_head] — the move-head / verify-clean primitives (submodule.c::submodule_move_headdry-run path + theunpack-trees.cwrapperscheck_submodule_move_head/verify_clean_submodule). These are the hooks the tree-switch (unpack-trees) engine calls to decide whether a HEAD move would lose submodule work.
The two halves are paired on purpose: a tree-switch needs the typed config (to know which paths are submodules and their bindings) AND the move-head check (to know whether moving each one is safe).