From dae1c82884feb69249dd0616c2a18131252ef4d2 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Thu, 4 Jul 2024 12:45:32 -0600 Subject: [PATCH] now working with issue #50 --- git_fleximod/git_fleximod.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/git_fleximod/git_fleximod.py b/git_fleximod/git_fleximod.py index c4e595d85b..2e282af434 100755 --- a/git_fleximod/git_fleximod.py +++ b/git_fleximod/git_fleximod.py @@ -215,9 +215,8 @@ def git_toplevelroot(root_dir, logger): superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") return superroot -def submodules_update(gitmodules, root_dir, requiredlist, force, submodules=None): - if not submodules: - submodules = {} +def submodules_update(gitmodules, root_dir, requiredlist, force): + submodules = {} for name in gitmodules.sections(): if not submodules or name not in submodules: submodules[name] = init_submodule_from_gitmodules(gitmodules, name, root_dir, logger) @@ -249,12 +248,11 @@ def submodules_update(gitmodules, root_dir, requiredlist, force, submodules=None # recursively handle this checkout print(f"Recursively checking out submodules of {name}") gitsubmodules = GitModules(submodules[name].logger, confpath=repodir) - requiredlist = ["AlwaysRequired"] + newrequiredlist = ["AlwaysRequired"] if optional: - requiredlist.append("AlwaysOptional") - - submodules_update(gitsubmodules, repodir, requiredlist, force=force, submodules=submodules) + newrequiredlist.append("AlwaysOptional") + submodules_update(gitsubmodules, repodir, newrequiredlist, force=force) def local_mods_output(): text = """\