checkout: Recursively sync submodules

Change-Id: Ie9645fd85d0043a2c4d0738e89c90277c813d0b0
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/104665
Commit-Queue: Rob Mohr <mohrr@google.com>
Reviewed-by: Marc-Antoine Ruel <maruel@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
diff --git a/recipe_modules/checkout/api.py b/recipe_modules/checkout/api.py
index 2aeb89f..30f3a49 100644
--- a/recipe_modules/checkout/api.py
+++ b/recipe_modules/checkout/api.py
@@ -874,7 +874,7 @@
                             pass
 
                     if submodules or submodule_paths:
-                        self.m.git.sync_submodule(**kwargs)
+                        self.m.git.sync_submodule(recursive=True, **kwargs)
                         self.m.git.update_submodule(
                             recursive=True,
                             force=True,
diff --git a/recipe_modules/checkout/tests/git.expected/ci.json b/recipe_modules/checkout/tests/git.expected/ci.json
index 8792434..97f17df 100644
--- a/recipe_modules/checkout/tests/git.expected/ci.json
+++ b/recipe_modules/checkout/tests/git.expected/ci.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/git.expected/not_in_gerrit.json b/recipe_modules/checkout/tests/git.expected/not_in_gerrit.json
index 8639e29..753fede 100644
--- a/recipe_modules/checkout/tests/git.expected/not_in_gerrit.json
+++ b/recipe_modules/checkout/tests/git.expected/not_in_gerrit.json
@@ -300,7 +300,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/git.expected/other.json b/recipe_modules/checkout/tests/git.expected/other.json
index c46121f..7118fc0 100644
--- a/recipe_modules/checkout/tests/git.expected/other.json
+++ b/recipe_modules/checkout/tests/git.expected/other.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/git.expected/try.json b/recipe_modules/checkout/tests/git.expected/try.json
index 2cf1a15..dfc7e54 100644
--- a/recipe_modules/checkout/tests/git.expected/try.json
+++ b/recipe_modules/checkout/tests/git.expected/try.json
@@ -652,7 +652,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-excluded.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-excluded.json
index a56ba41..898cc5f 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-excluded.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-excluded.json
@@ -480,7 +480,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-included.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-included.json
index e9639ff..21eb3a7 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-included.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-included.json
@@ -447,7 +447,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/build.expected/basic.json b/recipes/build.expected/basic.json
index f4d1457..5a90fec 100644
--- a/recipes/build.expected/basic.json
+++ b/recipes/build.expected/basic.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/build.expected/skip_archive.json b/recipes/build.expected/skip_archive.json
index f487162..9e3f212 100644
--- a/recipes/build.expected/skip_archive.json
+++ b/recipes/build.expected/skip_archive.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/bad_package_spec.json b/recipes/cipd_roller.expected/bad_package_spec.json
index 185c56d..1fa2fcd 100644
--- a/recipes/cipd_roller.expected/bad_package_spec.json
+++ b/recipes/cipd_roller.expected/bad_package_spec.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/missing_tag.json b/recipes/cipd_roller.expected/missing_tag.json
index f312579..d4b2458 100644
--- a/recipes/cipd_roller.expected/missing_tag.json
+++ b/recipes/cipd_roller.expected/missing_tag.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/multiple_common_tags.json b/recipes/cipd_roller.expected/multiple_common_tags.json
index 257cb08..396940d 100644
--- a/recipes/cipd_roller.expected/multiple_common_tags.json
+++ b/recipes/cipd_roller.expected/multiple_common_tags.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/no_common_tags.json b/recipes/cipd_roller.expected/no_common_tags.json
index b1520a0..0c43cbc 100644
--- a/recipes/cipd_roller.expected/no_common_tags.json
+++ b/recipes/cipd_roller.expected/no_common_tags.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/no_common_tags_and_relaxing_ref_mismatch_does_not_help.json b/recipes/cipd_roller.expected/no_common_tags_and_relaxing_ref_mismatch_does_not_help.json
index 4ec0296..a4606e7 100644
--- a/recipes/cipd_roller.expected/no_common_tags_and_relaxing_ref_mismatch_does_not_help.json
+++ b/recipes/cipd_roller.expected/no_common_tags_and_relaxing_ref_mismatch_does_not_help.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/no_common_tags_but_relaxing_ref_mismatch_helps.json b/recipes/cipd_roller.expected/no_common_tags_but_relaxing_ref_mismatch_helps.json
index 97fe4e5..63b09f1 100644
--- a/recipes/cipd_roller.expected/no_common_tags_but_relaxing_ref_mismatch_helps.json
+++ b/recipes/cipd_roller.expected/no_common_tags_but_relaxing_ref_mismatch_helps.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/no_curlies_in_spec.json b/recipes/cipd_roller.expected/no_curlies_in_spec.json
index ec5e3c3..5aaccc2 100644
--- a/recipes/cipd_roller.expected/no_curlies_in_spec.json
+++ b/recipes/cipd_roller.expected/no_curlies_in_spec.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/platform-independent.json b/recipes/cipd_roller.expected/platform-independent.json
index a9f0a3e..f6dbfbd 100644
--- a/recipes/cipd_roller.expected/platform-independent.json
+++ b/recipes/cipd_roller.expected/platform-independent.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/cipd_roller.expected/success.json b/recipes/cipd_roller.expected/success.json
index 10cd966..1fcb2bc 100644
--- a/recipes/cipd_roller.expected/success.json
+++ b/recipes/cipd_roller.expected/success.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/docs_builder.expected/docs.json b/recipes/docs_builder.expected/docs.json
index d851d63..1f1e030 100644
--- a/recipes/docs_builder.expected/docs.json
+++ b/recipes/docs_builder.expected/docs.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/docs_builder.expected/docs_dry_run.json b/recipes/docs_builder.expected/docs_dry_run.json
index b8462ab..580ace8 100644
--- a/recipes/docs_builder.expected/docs_dry_run.json
+++ b/recipes/docs_builder.expected/docs_dry_run.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/envtest.expected/environment_variables.json b/recipes/envtest.expected/environment_variables.json
index 908b757..d1de83e 100644
--- a/recipes/envtest.expected/environment_variables.json
+++ b/recipes/envtest.expected/environment_variables.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/envtest.expected/fail.json b/recipes/envtest.expected/fail.json
index 8844f04..cdd4d5e 100644
--- a/recipes/envtest.expected/fail.json
+++ b/recipes/envtest.expected/fail.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/envtest.expected/pigweed.json b/recipes/envtest.expected/pigweed.json
index f65afd6..24b6012 100644
--- a/recipes/envtest.expected/pigweed.json
+++ b/recipes/envtest.expected/pigweed.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/envtest.expected/windows.json b/recipes/envtest.expected/windows.json
index ea0fdcd..184cbe4 100644
--- a/recipes/envtest.expected/windows.json
+++ b/recipes/envtest.expected/windows.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]\\git\\pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/luci_config.expected/starlark.json b/recipes/luci_config.expected/starlark.json
index 3e17127..d153bd6 100644
--- a/recipes/luci_config.expected/starlark.json
+++ b/recipes/luci_config.expected/starlark.json
@@ -651,7 +651,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/pw_presubmit.expected/sign.json b/recipes/pw_presubmit.expected/sign.json
index f4705a9..1e6e478 100644
--- a/recipes/pw_presubmit.expected/sign.json
+++ b/recipes/pw_presubmit.expected/sign.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/pw_presubmit.expected/step.json b/recipes/pw_presubmit.expected/step.json
index a2d9900..b95f029 100644
--- a/recipes/pw_presubmit.expected/step.json
+++ b/recipes/pw_presubmit.expected/step.json
@@ -651,7 +651,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/recipes.expected/cq_try.json b/recipes/recipes.expected/cq_try.json
index ffb39f5..33207a9 100644
--- a/recipes/recipes.expected/cq_try.json
+++ b/recipes/recipes.expected/cq_try.json
@@ -651,7 +651,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/backwards.json b/recipes/repo_roller.expected/backwards.json
index 0ae66b8..58357e0 100644
--- a/recipes/repo_roller.expected/backwards.json
+++ b/recipes/repo_roller.expected/backwards.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/dotdot-prefix.json b/recipes/repo_roller.expected/dotdot-prefix.json
index ee91891..f2c00ac 100644
--- a/recipes/repo_roller.expected/dotdot-prefix.json
+++ b/recipes/repo_roller.expected/dotdot-prefix.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/equivalent.json b/recipes/repo_roller.expected/equivalent.json
index d104b89..8bc3102 100644
--- a/recipes/repo_roller.expected/equivalent.json
+++ b/recipes/repo_roller.expected/equivalent.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/host-dot-dot.json b/recipes/repo_roller.expected/host-dot-dot.json
index 1c7db38..b6da36e 100644
--- a/recipes/repo_roller.expected/host-dot-dot.json
+++ b/recipes/repo_roller.expected/host-dot-dot.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/host-prefix.json b/recipes/repo_roller.expected/host-prefix.json
index 39f63fe..440655b 100644
--- a/recipes/repo_roller.expected/host-prefix.json
+++ b/recipes/repo_roller.expected/host-prefix.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/name-not-found.json b/recipes/repo_roller.expected/name-not-found.json
index 56b714b..9714ceb 100644
--- a/recipes/repo_roller.expected/name-not-found.json
+++ b/recipes/repo_roller.expected/name-not-found.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/no-trigger-with-revision-branch.json b/recipes/repo_roller.expected/no-trigger-with-revision-branch.json
index f755477..3734b6c 100644
--- a/recipes/repo_roller.expected/no-trigger-with-revision-branch.json
+++ b/recipes/repo_roller.expected/no-trigger-with-revision-branch.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/no-trigger-with-revision-hash.json b/recipes/repo_roller.expected/no-trigger-with-revision-hash.json
index 433aea1..505aad4 100644
--- a/recipes/repo_roller.expected/no-trigger-with-revision-hash.json
+++ b/recipes/repo_roller.expected/no-trigger-with-revision-hash.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/no-trigger-with-revision-tag.json b/recipes/repo_roller.expected/no-trigger-with-revision-tag.json
index 516055e..e3adfdd 100644
--- a/recipes/repo_roller.expected/no-trigger-with-revision-tag.json
+++ b/recipes/repo_roller.expected/no-trigger-with-revision-tag.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/no-trigger-with-upstream.json b/recipes/repo_roller.expected/no-trigger-with-upstream.json
index 8321e5f..5c32434 100644
--- a/recipes/repo_roller.expected/no-trigger-with-upstream.json
+++ b/recipes/repo_roller.expected/no-trigger-with-upstream.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/success.json b/recipes/repo_roller.expected/success.json
index 9a4901b..280d06d 100644
--- a/recipes/repo_roller.expected/success.json
+++ b/recipes/repo_roller.expected/success.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/upstream-not-set-revision-not-branch.json b/recipes/repo_roller.expected/upstream-not-set-revision-not-branch.json
index a199d90..b3fdea1 100644
--- a/recipes/repo_roller.expected/upstream-not-set-revision-not-branch.json
+++ b/recipes/repo_roller.expected/upstream-not-set-revision-not-branch.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/repo_roller.expected/upstream-not-set.json b/recipes/repo_roller.expected/upstream-not-set.json
index 3fd7142..2c17f36 100644
--- a/recipes/repo_roller.expected/upstream-not-set.json
+++ b/recipes/repo_roller.expected/upstream-not-set.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/host.googlesource.com-manifest",
     "infra_step": true,
diff --git a/recipes/run_script.expected/run_script.json b/recipes/run_script.expected/run_script.json
index 13867ce..193c9b8 100644
--- a/recipes/run_script.expected/run_script.json
+++ b/recipes/run_script.expected/run_script.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/submodule_roller.expected/missing.json b/recipes/submodule_roller.expected/missing.json
index 0f89865..19d7a94 100644
--- a/recipes/submodule_roller.expected/missing.json
+++ b/recipes/submodule_roller.expected/missing.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/submodule_roller.expected/noop.json b/recipes/submodule_roller.expected/noop.json
index 0b56d70..53fd59b 100644
--- a/recipes/submodule_roller.expected/noop.json
+++ b/recipes/submodule_roller.expected/noop.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/submodule_roller.expected/partial_noop.json b/recipes/submodule_roller.expected/partial_noop.json
index c51bb5f..b3ad1e8 100644
--- a/recipes/submodule_roller.expected/partial_noop.json
+++ b/recipes/submodule_roller.expected/partial_noop.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/submodule_roller.expected/success.json b/recipes/submodule_roller.expected/success.json
index 69fe4e2..53879f6 100644
--- a/recipes/submodule_roller.expected/success.json
+++ b/recipes/submodule_roller.expected/success.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/target_to_cipd.expected/pw-presubmit.json b/recipes/target_to_cipd.expected/pw-presubmit.json
index 14012e5..55f67ce 100644
--- a/recipes/target_to_cipd.expected/pw-presubmit.json
+++ b/recipes/target_to_cipd.expected/pw-presubmit.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/target_to_git.expected/success.json b/recipes/target_to_git.expected/success.json
index d517647..9e59369 100644
--- a/recipes/target_to_git.expected/success.json
+++ b/recipes/target_to_git.expected/success.json
@@ -440,7 +440,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/tokendb_check.expected/addition.json b/recipes/tokendb_check.expected/addition.json
index 6537374..d6b8a09 100644
--- a/recipes/tokendb_check.expected/addition.json
+++ b/recipes/tokendb_check.expected/addition.json
@@ -776,7 +776,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/tokendb_check.expected/no-change.json b/recipes/tokendb_check.expected/no-change.json
index 6537374..d6b8a09 100644
--- a/recipes/tokendb_check.expected/no-change.json
+++ b/recipes/tokendb_check.expected/no-change.json
@@ -776,7 +776,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/tokendb_check.expected/removal.json b/recipes/tokendb_check.expected/removal.json
index 0eac753..715c14c 100644
--- a/recipes/tokendb_check.expected/removal.json
+++ b/recipes/tokendb_check.expected/removal.json
@@ -776,7 +776,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/tokendb_updater.expected/dry-run.json b/recipes/tokendb_updater.expected/dry-run.json
index 1bca1d2..d5e1056 100644
--- a/recipes/tokendb_updater.expected/dry-run.json
+++ b/recipes/tokendb_updater.expected/dry-run.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/tokendb_updater.expected/separate-repo.json b/recipes/tokendb_updater.expected/separate-repo.json
index f8b8a0b..810b377 100644
--- a/recipes/tokendb_updater.expected/separate-repo.json
+++ b/recipes/tokendb_updater.expected/separate-repo.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/tokendb_updater.expected/simple.json b/recipes/tokendb_updater.expected/simple.json
index 69f142d..0e6e7d1 100644
--- a/recipes/tokendb_updater.expected/simple.json
+++ b/recipes/tokendb_updater.expected/simple.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/txt_roller.expected/backwards.json b/recipes/txt_roller.expected/backwards.json
index b3c82cb..52050e9 100644
--- a/recipes/txt_roller.expected/backwards.json
+++ b/recipes/txt_roller.expected/backwards.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/txt_roller.expected/bad-trigger.json b/recipes/txt_roller.expected/bad-trigger.json
index 9d04e83..5e05970 100644
--- a/recipes/txt_roller.expected/bad-trigger.json
+++ b/recipes/txt_roller.expected/bad-trigger.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/txt_roller.expected/no-trigger.json b/recipes/txt_roller.expected/no-trigger.json
index 980130c..b03b36a 100644
--- a/recipes/txt_roller.expected/no-trigger.json
+++ b/recipes/txt_roller.expected/no-trigger.json
@@ -149,7 +149,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/txt_roller.expected/success.json b/recipes/txt_roller.expected/success.json
index c56c7ca..d4ec63d 100644
--- a/recipes/txt_roller.expected/success.json
+++ b/recipes/txt_roller.expected/success.json
@@ -245,7 +245,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/update_python_versions.expected/simple.json b/recipes/update_python_versions.expected/simple.json
index caeec7a..57c9fd3 100644
--- a/recipes/update_python_versions.expected/simple.json
+++ b/recipes/update_python_versions.expected/simple.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/xrefs.expected/dry_run.json b/recipes/xrefs.expected/dry_run.json
index ec157c4..bcfff40 100644
--- a/recipes/xrefs.expected/dry_run.json
+++ b/recipes/xrefs.expected/dry_run.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/xrefs.expected/kythe.json b/recipes/xrefs.expected/kythe.json
index 0790b5d..3dfbb6f 100644
--- a/recipes/xrefs.expected/kythe.json
+++ b/recipes/xrefs.expected/kythe.json
@@ -305,7 +305,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,
diff --git a/recipes/xrefs.expected/tryjob.json b/recipes/xrefs.expected/tryjob.json
index 8a003ff..16826bc 100644
--- a/recipes/xrefs.expected/tryjob.json
+++ b/recipes/xrefs.expected/tryjob.json
@@ -651,7 +651,8 @@
     "cmd": [
       "git",
       "submodule",
-      "sync"
+      "sync",
+      "--recursive"
     ],
     "cwd": "[CACHE]/git/pigweed.googlesource.com-pigweed-pigweed",
     "infra_step": true,