checkout: Fetch all remote branches

This seems to fix an issue where a newly-fetched branch does not exist.

Tested with led:
https://ci.chromium.org/swarming/task/57aede4a656b6e10?server=chrome-swarming.appspot.com

Bug: 578
Change-Id: Ibe5ae98d4693d82d317cb42265aa59c2f6430c2f
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/72680
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Reviewed-by: Ted Pudlik <tpudlik@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
diff --git a/recipe_modules/checkout/api.py b/recipe_modules/checkout/api.py
index cf34960..d1a7904 100644
--- a/recipe_modules/checkout/api.py
+++ b/recipe_modules/checkout/api.py
@@ -555,7 +555,8 @@
                     self.m.git('pre-rebase log', 'log', '--oneline', '-n', '10')
                     self.m.git.fetch(
                         remote,
-                        change.branch,
+                        # TODO(pwbug/578) Stop fetching all branches.
+                        # change.branch,
                         prune=False,
                         step_name='git fetch branch',
                     )
diff --git a/recipe_modules/checkout/tests/git.expected/no_props.json b/recipe_modules/checkout/tests/git.expected/no_props.json
index 95de2fd..461d0cd 100644
--- a/recipe_modules/checkout/tests/git.expected/no_props.json
+++ b/recipe_modules/checkout/tests/git.expected/no_props.json
@@ -1102,8 +1102,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/git.expected/try.json b/recipe_modules/checkout/tests/git.expected/try.json
index 15a3714..4760e8c 100644
--- a/recipe_modules/checkout/tests/git.expected/try.json
+++ b/recipe_modules/checkout/tests/git.expected/try.json
@@ -1102,8 +1102,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/feature_branches_try.json b/recipe_modules/checkout/tests/repo.expected/feature_branches_try.json
index 3fc3a35..51c0a02 100644
--- a/recipe_modules/checkout/tests/repo.expected/feature_branches_try.json
+++ b/recipe_modules/checkout/tests/repo.expected/feature_branches_try.json
@@ -981,8 +981,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_name",
-      "feature1"
+      "https___pigweed_googlesource_com_pigweed_name"
     ],
     "cwd": "[START_DIR]/checkout/pigweed_path",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/feature_branches_try_multiple_features.json b/recipe_modules/checkout/tests/repo.expected/feature_branches_try_multiple_features.json
index 03b5973..cd8256e 100644
--- a/recipe_modules/checkout/tests/repo.expected/feature_branches_try_multiple_features.json
+++ b/recipe_modules/checkout/tests/repo.expected/feature_branches_try_multiple_features.json
@@ -1070,8 +1070,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_name",
-      "feature1"
+      "https___pigweed_googlesource_com_pigweed_name"
     ],
     "cwd": "[START_DIR]/checkout/pigweed_path",
     "infra_step": true,
@@ -1321,8 +1320,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___default_googlesource_com_default_name",
-      "feature2"
+      "https___default_googlesource_com_default_name"
     ],
     "cwd": "[START_DIR]/checkout/default_path",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/prefix.json b/recipe_modules/checkout/tests/repo.expected/prefix.json
index c7330b0..7f22e94 100644
--- a/recipe_modules/checkout/tests/repo.expected/prefix.json
+++ b/recipe_modules/checkout/tests/repo.expected/prefix.json
@@ -924,8 +924,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___foo_googlesource_com_prefix_suffix",
-      "main"
+      "https___foo_googlesource_com_prefix_suffix"
     ],
     "cwd": "[START_DIR]/checkout/prefix/suffix",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/try-multiple-cqdeps.json b/recipe_modules/checkout/tests/repo.expected/try-multiple-cqdeps.json
index e382194..62337fb 100644
--- a/recipe_modules/checkout/tests/repo.expected/try-multiple-cqdeps.json
+++ b/recipe_modules/checkout/tests/repo.expected/try-multiple-cqdeps.json
@@ -1151,8 +1151,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_name",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_name"
     ],
     "cwd": "[START_DIR]/checkout/pigweed_path",
     "infra_step": true,
@@ -1402,8 +1401,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___default_googlesource_com_default_name",
-      "main"
+      "https___default_googlesource_com_default_name"
     ],
     "cwd": "[START_DIR]/checkout/default_path",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/try-multiple-onenotapplied.json b/recipe_modules/checkout/tests/repo.expected/try-multiple-onenotapplied.json
index 78d1209..e8147f2 100644
--- a/recipe_modules/checkout/tests/repo.expected/try-multiple-onenotapplied.json
+++ b/recipe_modules/checkout/tests/repo.expected/try-multiple-onenotapplied.json
@@ -1033,8 +1033,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_name",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_name"
     ],
     "cwd": "[START_DIR]/checkout/pigweed_path",
     "infra_step": true,
@@ -1284,8 +1283,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___default_googlesource_com_default_name",
-      "main"
+      "https___default_googlesource_com_default_name"
     ],
     "cwd": "[START_DIR]/checkout/default_path",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/try-multiple.json b/recipe_modules/checkout/tests/repo.expected/try-multiple.json
index 8d95269..7526d6b 100644
--- a/recipe_modules/checkout/tests/repo.expected/try-multiple.json
+++ b/recipe_modules/checkout/tests/repo.expected/try-multiple.json
@@ -978,8 +978,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_name",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_name"
     ],
     "cwd": "[START_DIR]/checkout/pigweed_path",
     "infra_step": true,
@@ -1229,8 +1228,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___default_googlesource_com_default_name",
-      "main"
+      "https___default_googlesource_com_default_name"
     ],
     "cwd": "[START_DIR]/checkout/default_path",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/try.json b/recipe_modules/checkout/tests/repo.expected/try.json
index e7ffdd395..86b224a 100644
--- a/recipe_modules/checkout/tests/repo.expected/try.json
+++ b/recipe_modules/checkout/tests/repo.expected/try.json
@@ -924,8 +924,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_name",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_name"
     ],
     "cwd": "[START_DIR]/checkout/pigweed_path",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/repo.expected/try_manifest.json b/recipe_modules/checkout/tests/repo.expected/try_manifest.json
index 8d6d39f..f54fb61 100644
--- a/recipe_modules/checkout/tests/repo.expected/try_manifest.json
+++ b/recipe_modules/checkout/tests/repo.expected/try_manifest.json
@@ -693,8 +693,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_manifest",
-      "feature-not-in-manifest"
+      "https___pigweed_googlesource_com_pigweed_manifest"
     ],
     "cwd": "[START_DIR]/checkout/.repo/manifests",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-equivalent.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-equivalent.json
index c667a92..217c36d 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-equivalent.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-equivalent.json
@@ -1266,8 +1266,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___z_googlesource_com_foo",
-      "main"
+      "https___z_googlesource_com_foo"
     ],
     "cwd": "[START_DIR]/checkout/foo",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-cqdeps.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-cqdeps.json
index 4a0998c..e6501f1 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-cqdeps.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-cqdeps.json
@@ -1556,8 +1556,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
@@ -1963,8 +1962,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_foo",
-      "main"
+      "https___x_googlesource_com_foo"
     ],
     "cwd": "[START_DIR]/checkout/foo",
     "infra_step": true,
@@ -2206,8 +2204,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_bar",
-      "main"
+      "https___x_googlesource_com_bar"
     ],
     "cwd": "[START_DIR]/checkout/bar",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing-one-forbidden-cqdeps.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing-one-forbidden-cqdeps.json
index 6d7d0f1..f139964 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing-one-forbidden-cqdeps.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing-one-forbidden-cqdeps.json
@@ -1655,8 +1655,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
@@ -2062,8 +2061,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_foo",
-      "main"
+      "https___x_googlesource_com_foo"
     ],
     "cwd": "[START_DIR]/checkout/foo",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing.json
index a0e260f..e8f61e3 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple-one-missing.json
@@ -1211,8 +1211,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
@@ -1618,8 +1617,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_foo",
-      "main"
+      "https___x_googlesource_com_foo"
     ],
     "cwd": "[START_DIR]/checkout/foo",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple.json
index ed8055f..a00819a 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try-multiple.json
@@ -1210,8 +1210,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
@@ -1617,8 +1616,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_foo",
-      "main"
+      "https___x_googlesource_com_foo"
     ],
     "cwd": "[START_DIR]/checkout/foo",
     "infra_step": true,
@@ -1860,8 +1858,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_bar",
-      "main"
+      "https___x_googlesource_com_bar"
     ],
     "cwd": "[START_DIR]/checkout/bar",
     "infra_step": true,
diff --git a/recipe_modules/checkout/tests/submodule.expected/submodule-try.json b/recipe_modules/checkout/tests/submodule.expected/submodule-try.json
index 9ddebd0..e3ea935 100644
--- a/recipe_modules/checkout/tests/submodule.expected/submodule-try.json
+++ b/recipe_modules/checkout/tests/submodule.expected/submodule-try.json
@@ -1266,8 +1266,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___x_googlesource_com_baz",
-      "main"
+      "https___x_googlesource_com_baz"
     ],
     "cwd": "[START_DIR]/checkout/baz",
     "infra_step": true,
diff --git a/recipes/luci_config.expected/starlark.json b/recipes/luci_config.expected/starlark.json
index 8a1b47b..2f72781 100644
--- a/recipes/luci_config.expected/starlark.json
+++ b/recipes/luci_config.expected/starlark.json
@@ -1102,8 +1102,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipes/pw_presubmit.expected/step.json b/recipes/pw_presubmit.expected/step.json
index 3cf954b..2fc533f 100644
--- a/recipes/pw_presubmit.expected/step.json
+++ b/recipes/pw_presubmit.expected/step.json
@@ -1102,8 +1102,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipes/recipes.expected/cq_try.json b/recipes/recipes.expected/cq_try.json
index 7224761..7bb308c 100644
--- a/recipes/recipes.expected/cq_try.json
+++ b/recipes/recipes.expected/cq_try.json
@@ -1102,8 +1102,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipes/tokendb_check.expected/addition.json b/recipes/tokendb_check.expected/addition.json
index 2a12060..4c8afb9 100644
--- a/recipes/tokendb_check.expected/addition.json
+++ b/recipes/tokendb_check.expected/addition.json
@@ -1225,8 +1225,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipes/tokendb_check.expected/no-change.json b/recipes/tokendb_check.expected/no-change.json
index 2a12060..4c8afb9 100644
--- a/recipes/tokendb_check.expected/no-change.json
+++ b/recipes/tokendb_check.expected/no-change.json
@@ -1225,8 +1225,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipes/tokendb_check.expected/removal.json b/recipes/tokendb_check.expected/removal.json
index 3e452d7..a421a95 100644
--- a/recipes/tokendb_check.expected/removal.json
+++ b/recipes/tokendb_check.expected/removal.json
@@ -1225,8 +1225,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,
diff --git a/recipes/xrefs.expected/tryjob.json b/recipes/xrefs.expected/tryjob.json
index 1284699..1d81da5 100644
--- a/recipes/xrefs.expected/tryjob.json
+++ b/recipes/xrefs.expected/tryjob.json
@@ -1102,8 +1102,7 @@
     "cmd": [
       "git",
       "fetch",
-      "https___pigweed_googlesource_com_pigweed_pigweed",
-      "main"
+      "https___pigweed_googlesource_com_pigweed_pigweed"
     ],
     "cwd": "[START_DIR]/checkout",
     "infra_step": true,