checkout: Dump git rewrite config

Bug: b/290395877
Change-Id: Ia6dd130e810092ce764a5a8b38c1f46a3f7a6630
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/161950
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Reviewed-by: William Abajian <williamabajian@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Rob Mohr <mohrr@google.com>
diff --git a/recipe_modules/checkout/api.py b/recipe_modules/checkout/api.py
index 9b5f5ab..2b92fbc 100644
--- a/recipe_modules/checkout/api.py
+++ b/recipe_modules/checkout/api.py
@@ -1294,6 +1294,8 @@
                     rewrite.original,
                 )
 
+            self.m.git("rewrites", "config", "--get-regexp", "^url.*")
+
     def _name(self, options):
         """Turn "https://foo/bar/baz.git" into "baz"."""
         name = options.remote.rstrip('/')
diff --git a/recipe_modules/checkout/tests/submodule.expected/insteadof.json b/recipe_modules/checkout/tests/submodule.expected/insteadof.json
index 0864c52..9b3fb0e 100644
--- a/recipe_modules/checkout/tests/submodule.expected/insteadof.json
+++ b/recipe_modules/checkout/tests/submodule.expected/insteadof.json
@@ -446,6 +446,31 @@
     ]
   },
   {
+    "cmd": [
+      "git",
+      "config",
+      "--get-regexp",
+      "^url.*"
+    ],
+    "luci_context": {
+      "realm": {
+        "name": "project:try"
+      },
+      "resultdb": {
+        "current_invocation": {
+          "name": "invocations/build:8945511751514863184",
+          "update_token": "token"
+        },
+        "hostname": "rdbhost"
+      }
+    },
+    "name": "checkout pigweed.insteadof.rewrites",
+    "timeout": 600.0,
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@2@@@"
+    ]
+  },
+  {
     "cmd": [],
     "name": "checkout pigweed.no non-standard branch names",
     "~followup_annotations": [