Skip to main content

check_submodule_move_head

Function check_submodule_move_head 

Source
pub fn check_submodule_move_head(
    is_submodule: bool,
    ctx: &MoveHeadContext,
    old_id: Option<&str>,
    new_id: Option<&str>,
    reset: bool,
) -> MoveHeadVerdict
Expand description

Port of check_submodule_move_head (git unpack-trees.c). Thin wrapper that always runs in dry-run mode and translates o->reset into the FORCE flag.

is_submodule mirrors submodule_from_ce(ce): when the cache entry is not a submodule (no .gitmodules binding), the check is a no-op Ok. The caller resolves that from the typed crate::config::SubmoduleConfigSet.