Skip to main content

Module fetch_submodules

Module fetch_submodules 

Source
Expand description

Logic for git fetch --recurse-submodules (changed-submodule detection and config).

Mirrors the subset of Git’s submodule.c / submodule-config.c needed for recursive fetch: revision walking with merge-aware gitlink diffs, per-submodule recurse mode, and checking whether recorded gitlink commits are already present in a submodule repository.

Structs§

ChangedSubmoduleFetch
One submodule that gained new gitlink targets in rev-list <tips> --not <neg>.

Enums§

FetchRecurseSubmodules
fetch.recurseSubmodules / --recurse-submodules modes for fetch.

Functions§

collect_changed_submodules_for_fetch
Walk rev_list(repo, positive_hex, negative_hex) and collect submodule names whose gitlink targets changed, matching Git’s collect_changed_submodules + name resolution.
is_submodule_active_for_fetch
Whether a submodule at path is active for fetch at super_oid (Git is_tree_submodule_active subset).
merge_tips_for_changed_walk
Parse fetch.recurseSubmodules or --recurse-submodules=<value> (Git parse_fetch_recurse_submodules_arg). Build the positive OID list for rev-list when diffing fetched history (Git ref_tips_after ∪ submodule tips).
might_have_submodules_to_fetch
.gitmodules says at least one submodule exists (path+url), or absorbed modules exist.
parse_fetch_recurse_submodules_arg
repo_has_absorbed_submodules
Superproject has at least one submodule under .git/modules/ (Git repo_has_absorbed_submodules).
submodule_git_dir_for_fetch
Open the git directory for a submodule at rel_path (work tree or .git/modules/ fallback).
submodule_has_all_commits
True when every OID in commits exists as a commit object in sub_odb and is reachable from some ref (git rev-list -n 1 <oids> --not --all is empty), matching Git’s submodule_has_commits.