From 0cd64f21eac57734daa35d0e8b2ba0e227bf5699 Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Wed, 19 Aug 2026 16:56:39 +0000 Subject: [PATCH] fix: ensure submodule files are included with --recurse-submodules --- codecov_cli/helpers/versioning_systems.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/codecov_cli/helpers/versioning_systems.py b/codecov_cli/helpers/versioning_systems.py index ffe2292f4..96a321a6c 100644 --- a/codecov_cli/helpers/versioning_systems.py +++ b/codecov_cli/helpers/versioning_systems.py @@ -170,6 +170,25 @@ def list_relevant_files( if dir_to_use is None: raise ValueError("Can't determine root folder") + if recurse_submodules: + init_res = subprocess.run( + [ + "git", + "-C", + str(dir_to_use), + "submodule", + "update", + "--init", + "--recursive", + ], + capture_output=True, + ) + if init_res.returncode != 0: + logger.warning( + "git submodule update --init --recursive failed; submodule files may be missing from the network. " + + init_res.stderr.decode().strip() + ) + cmd = ["git", "-C", str(dir_to_use), "ls-files", "-z"] if recurse_submodules: cmd.append("--recurse-submodules")