[checkout] Resolve remote branch HEAD for patchset checkouts

Instead of passing HEAD to `jiri import`, resolve it through git
ls-remote. This allows us to direct Jiri to checkout an exact revision
of integration, since Jiri gets confused when trying to checkout
non-master branches otherwise.

Bug: 69324
Change-Id: I42c19c62a38041c32f99e8ae024e562c5fac7726
Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/511043
Commit-Queue: Anthony Fandrianto <atyfto@google.com>
Reviewed-by: Nathan Mulcahey <nmulcahey@google.com>
Reviewed-by: Oliver Newman <olivernewman@google.com>
(cherry picked from commit 39bb60f92b81c77ac1b950ea2d1f29480a41134d)
diff --git a/recipe_modules/artifacts/examples/full.expected/basic.json b/recipe_modules/artifacts/examples/full.expected/basic.json
index d83fff3..fb76f56 100644
--- a/recipe_modules/artifacts/examples/full.expected/basic.json
+++ b/recipe_modules/artifacts/examples/full.expected/basic.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/__init__.py b/recipe_modules/checkout/__init__.py
index f110acd..dc96e74 100644
--- a/recipe_modules/checkout/__init__.py
+++ b/recipe_modules/checkout/__init__.py
@@ -8,6 +8,7 @@
     "fuchsia/git",
     "fuchsia/jiri",
     "fuchsia/release",
+    "fuchsia/sso",
     "fuchsia/status_check",
     "fuchsia/upload",
     "recipe_engine/buildbucket",
diff --git a/recipe_modules/checkout/api.py b/recipe_modules/checkout/api.py
index 9aad863..2cab0b7 100644
--- a/recipe_modules/checkout/api.py
+++ b/recipe_modules/checkout/api.py
@@ -441,8 +441,11 @@
                 # extremely rare in practice because since we rarely make
                 # changes that simultaneously affect infra and non-infra parts
                 # of integration like jiri manifests.
-                revision="HEAD",
-                remote_branch=change_details["branch"],
+                revision=self.m.git.get_remote_branch_head(
+                    url=self.m.sso.sso_to_https(remote),
+                    branch=change_details["branch"],
+                    step_name="resolve HEAD",
+                ),
             )
 
             self.m.jiri.update(
diff --git a/recipe_modules/checkout/examples/full.expected/default.json b/recipe_modules/checkout/examples/full.expected/default.json
index 44ac66f..1b7384c 100644
--- a/recipe_modules/checkout/examples/full.expected/default.json
+++ b/recipe_modules/checkout/examples/full.expected/default.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/fail_to_patch_over_gerrit_change.json b/recipe_modules/checkout/examples/full.expected/fail_to_patch_over_gerrit_change.json
index 7335950..8427d73 100644
--- a/recipe_modules/checkout/examples/full.expected/fail_to_patch_over_gerrit_change.json
+++ b/recipe_modules/checkout/examples/full.expected/fail_to_patch_over_gerrit_change.json
@@ -182,6 +182,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -189,8 +204,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/fail_to_patch_same_project_many_times.json b/recipe_modules/checkout/examples/full.expected/fail_to_patch_same_project_many_times.json
index 4a26155..2215c80 100644
--- a/recipe_modules/checkout/examples/full.expected/fail_to_patch_same_project_many_times.json
+++ b/recipe_modules/checkout/examples/full.expected/fail_to_patch_same_project_many_times.json
@@ -182,6 +182,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -189,8 +204,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/global_integration_tryjob.json b/recipe_modules/checkout/examples/full.expected/global_integration_tryjob.json
index 96db3f7..4c1d9c4 100644
--- a/recipe_modules/checkout/examples/full.expected/global_integration_tryjob.json
+++ b/recipe_modules/checkout/examples/full.expected/global_integration_tryjob.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/global_integration_tryjob_bad_cipd_change.json b/recipe_modules/checkout/examples/full.expected/global_integration_tryjob_bad_cipd_change.json
index fa49a16..1b84622 100644
--- a/recipe_modules/checkout/examples/full.expected/global_integration_tryjob_bad_cipd_change.json
+++ b/recipe_modules/checkout/examples/full.expected/global_integration_tryjob_bad_cipd_change.json
@@ -182,6 +182,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -189,8 +204,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob.json b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob.json
index f356233..89d8535 100644
--- a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob.json
+++ b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_failure.json b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_failure.json
index 0a7848a..b1a9cb1 100644
--- a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_failure.json
+++ b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_failure.json
@@ -182,6 +182,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -189,8 +204,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_no_such_project.json b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_no_such_project.json
index 44fa551..d7314f6 100644
--- a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_no_such_project.json
+++ b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_no_such_project.json
@@ -182,6 +182,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -189,8 +204,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_rebase_failure.json b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_rebase_failure.json
index f6c5e74..828da18 100644
--- a/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_rebase_failure.json
+++ b/recipe_modules/checkout/examples/full.expected/local_integration_tryjob_patch_rebase_failure.json
@@ -182,6 +182,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -189,8 +204,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/should_ignore_patches_for_non_dependant_projects.json b/recipe_modules/checkout/examples/full.expected/should_ignore_patches_for_non_dependant_projects.json
index 2954c50..41de63c 100644
--- a/recipe_modules/checkout/examples/full.expected/should_ignore_patches_for_non_dependant_projects.json
+++ b/recipe_modules/checkout/examples/full.expected/should_ignore_patches_for_non_dependant_projects.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/should_ignore_recipe_changes.json b/recipe_modules/checkout/examples/full.expected/should_ignore_recipe_changes.json
index 0b1beae..7b9a014 100644
--- a/recipe_modules/checkout/examples/full.expected/should_ignore_recipe_changes.json
+++ b/recipe_modules/checkout/examples/full.expected/should_ignore_recipe_changes.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/tryjob_with_patchfile.json b/recipe_modules/checkout/examples/full.expected/tryjob_with_patchfile.json
index 64d765a..5aa2a0d 100644
--- a/recipe_modules/checkout/examples/full.expected/tryjob_with_patchfile.json
+++ b/recipe_modules/checkout/examples/full.expected/tryjob_with_patchfile.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/checkout/examples/full.expected/when_patchfile_host_has_protocol.json b/recipe_modules/checkout/examples/full.expected/when_patchfile_host_has_protocol.json
index f782350..ed5797a 100644
--- a/recipe_modules/checkout/examples/full.expected/when_patchfile_host_has_protocol.json
+++ b/recipe_modules/checkout/examples/full.expected/when_patchfile_host_has_protocol.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/black.json b/recipe_modules/tricium_analyze/examples/full.expected/black.json
index 40d4021..a45a597 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/black.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/black.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/clang_format.json b/recipe_modules/tricium_analyze/examples/full.expected/clang_format.json
index 9f21c04..7f813b0 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/clang_format.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/clang_format.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy.json b/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy.json
index c292b90..bee5448 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_bad_offset.json b/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_bad_offset.json
index b98aed4..3158e23 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_bad_offset.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_bad_offset.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_error.json b/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_error.json
index 4d50fe9..99945c8 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_error.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/clang_tidy_error.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/cmc.json b/recipe_modules/tricium_analyze/examples/full.expected/cmc.json
index 37865a6..beea3ae 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/cmc.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/cmc.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/dartfmt.json b/recipe_modules/tricium_analyze/examples/full.expected/dartfmt.json
index 3be0576..2ecd0c6 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/dartfmt.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/dartfmt.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/fidl_format.json b/recipe_modules/tricium_analyze/examples/full.expected/fidl_format.json
index 5791396..ee04575 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/fidl_format.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/fidl_format.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/fidl_lint.json b/recipe_modules/tricium_analyze/examples/full.expected/fidl_lint.json
index 7df0621..03249af 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/fidl_lint.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/fidl_lint.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/gn_format.json b/recipe_modules/tricium_analyze/examples/full.expected/gn_format.json
index 161596f..6cef227 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/gn_format.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/gn_format.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/go_vet.json b/recipe_modules/tricium_analyze/examples/full.expected/go_vet.json
index 9c42905..c4dfc6f 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/go_vet.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/go_vet.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/go_vet_build_fails.json b/recipe_modules/tricium_analyze/examples/full.expected/go_vet_build_fails.json
index 65d306b..11b5b82 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/go_vet_build_fails.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/go_vet_build_fails.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/go_vet_no_warnings.json b/recipe_modules/tricium_analyze/examples/full.expected/go_vet_no_warnings.json
index 4f83c71..58fcc5c 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/go_vet_no_warnings.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/go_vet_no_warnings.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/gofmt.json b/recipe_modules/tricium_analyze/examples/full.expected/gofmt.json
index 4653bda..27bf4a6 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/gofmt.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/gofmt.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/json5.json b/recipe_modules/tricium_analyze/examples/full.expected/json5.json
index 2eca071..29dec87 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/json5.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/json5.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/no_analysis.json b/recipe_modules/tricium_analyze/examples/full.expected/no_analysis.json
index dc14345..6bd3a21 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/no_analysis.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/no_analysis.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/no_commit_message.json b/recipe_modules/tricium_analyze/examples/full.expected/no_commit_message.json
index 7ff6e5d..ee24e73 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/no_commit_message.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/no_commit_message.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/no_commit_tag.json b/recipe_modules/tricium_analyze/examples/full.expected/no_commit_tag.json
index 086dcd3..e707614 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/no_commit_tag.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/no_commit_tag.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/rustfmt.json b/recipe_modules/tricium_analyze/examples/full.expected/rustfmt.json
index 185f9a0..046766f 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/rustfmt.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/rustfmt.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/valid_commit_tag.json b/recipe_modules/tricium_analyze/examples/full.expected/valid_commit_tag.json
index dc14345..6bd3a21 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/valid_commit_tag.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/valid_commit_tag.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/yapf.json b/recipe_modules/tricium_analyze/examples/full.expected/yapf.json
index ba91d65..750ab72 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/yapf.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/yapf.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipe_modules/tricium_analyze/examples/full.expected/yapf_no_fx.json b/recipe_modules/tricium_analyze/examples/full.expected/yapf_no_fx.json
index 0a741e8..a7759cd 100644
--- a/recipe_modules/tricium_analyze/examples/full.expected/yapf_no_fx.json
+++ b/recipe_modules/tricium_analyze/examples/full.expected/yapf_no_fx.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipes/3p_prebuilts.expected/try.json b/recipes/3p_prebuilts.expected/try.json
index 04409b4..4e2870f 100644
--- a/recipes/3p_prebuilts.expected/try.json
+++ b/recipes/3p_prebuilts.expected/try.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/3p_prebuilts",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "third_party/prebuilts",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "third_party/prebuilts",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/cobalt.expected/cq_try.json b/recipes/cobalt.expected/cq_try.json
index f49b4d2..d480021 100644
--- a/recipes/cobalt.expected/cq_try.json
+++ b/recipes/cobalt.expected/cq_try.json
@@ -213,6 +213,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -220,8 +234,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "cobalt",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/cobalt_config.expected/cq_try.json b/recipes/cobalt_config.expected/cq_try.json
index ccd8416..ed13591 100644
--- a/recipes/cobalt_config.expected/cq_try.json
+++ b/recipes/cobalt_config.expected/cq_try.json
@@ -213,6 +213,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -220,8 +234,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "config.manifest",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/cobalt_config.expected/cq_try_not_cobalt_config.json b/recipes/cobalt_config.expected/cq_try_not_cobalt_config.json
index 60ec6db..62dad78 100644
--- a/recipes/cobalt_config.expected/cq_try_not_cobalt_config.json
+++ b/recipes/cobalt_config.expected/cq_try_not_cobalt_config.json
@@ -213,6 +213,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -220,8 +234,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "config.manifest",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/ffmpeg.expected/cq.json b/recipes/ffmpeg.expected/cq.json
index 44d1ffd..8177eb6 100644
--- a/recipes/ffmpeg.expected/cq.json
+++ b/recipes/ffmpeg.expected/cq.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "third_party/ffmpeg",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/fuchsia/build.expected/affected_tests_no_work.json b/recipes/fuchsia/build.expected/affected_tests_no_work.json
index 6ce08ab..3634029 100644
--- a/recipes/fuchsia/build.expected/affected_tests_no_work.json
+++ b/recipes/fuchsia/build.expected/affected_tests_no_work.json
@@ -551,6 +551,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -558,8 +573,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/build.expected/cq_perfcompare.json b/recipes/fuchsia/build.expected/cq_perfcompare.json
index 76a6c7e..d6c41f8 100644
--- a/recipes/fuchsia/build.expected/cq_perfcompare.json
+++ b/recipes/fuchsia/build.expected/cq_perfcompare.json
@@ -552,6 +552,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -559,8 +574,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/build.expected/default_cq.json b/recipes/fuchsia/build.expected/default_cq.json
index f209352..8c95585 100644
--- a/recipes/fuchsia/build.expected/default_cq.json
+++ b/recipes/fuchsia/build.expected/default_cq.json
@@ -552,6 +552,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -559,8 +574,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/build.expected/default_cq_no_affected_retry_task_on_test_failure.json b/recipes/fuchsia/build.expected/default_cq_no_affected_retry_task_on_test_failure.json
index ea8ef8d..a0b590a 100644
--- a/recipes/fuchsia/build.expected/default_cq_no_affected_retry_task_on_test_failure.json
+++ b/recipes/fuchsia/build.expected/default_cq_no_affected_retry_task_on_test_failure.json
@@ -553,6 +553,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -560,8 +575,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/build.expected/default_multipliers.json b/recipes/fuchsia/build.expected/default_multipliers.json
index cee3b39..b4d3380 100644
--- a/recipes/fuchsia/build.expected/default_multipliers.json
+++ b/recipes/fuchsia/build.expected/default_multipliers.json
@@ -789,6 +789,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -796,8 +811,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/build.expected/failed_build_cq.json b/recipes/fuchsia/build.expected/failed_build_cq.json
index 47e9f49..bd77fcb 100644
--- a/recipes/fuchsia/build.expected/failed_build_cq.json
+++ b/recipes/fuchsia/build.expected/failed_build_cq.json
@@ -539,6 +539,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -546,8 +561,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/build.expected/skip_if_unaffected.json b/recipes/fuchsia/build.expected/skip_if_unaffected.json
index 522f15f..937cbcf 100644
--- a/recipes/fuchsia/build.expected/skip_if_unaffected.json
+++ b/recipes/fuchsia/build.expected/skip_if_unaffected.json
@@ -551,6 +551,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -558,8 +573,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/coverage.expected/default_led.json b/recipes/fuchsia/coverage.expected/default_led.json
index f6ae3e2..5c6176f 100644
--- a/recipes/fuchsia/coverage.expected/default_led.json
+++ b/recipes/fuchsia/coverage.expected/default_led.json
@@ -1027,6 +1027,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -1034,8 +1049,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/coverage.expected/skipped_build.json b/recipes/fuchsia/coverage.expected/skipped_build.json
index 974b053..2a11746 100644
--- a/recipes/fuchsia/coverage.expected/skipped_build.json
+++ b/recipes/fuchsia/coverage.expected/skipped_build.json
@@ -689,6 +689,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -696,8 +711,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/fuchsia/coverage.expected/skipped_testing.json b/recipes/fuchsia/coverage.expected/skipped_testing.json
index 5195ef4..0633f8d 100644
--- a/recipes/fuchsia/coverage.expected/skipped_testing.json
+++ b/recipes/fuchsia/coverage.expected/skipped_testing.json
@@ -689,6 +689,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -696,8 +711,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/jiri.expected/cq_try.json b/recipes/jiri.expected/cq_try.json
index 7fc5b44..b0e806b 100644
--- a/recipes/jiri.expected/cq_try.json
+++ b/recipes/jiri.expected/cq_try.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "jiri",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "jiri",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/kythe.expected/try.json b/recipes/kythe.expected/try.json
index 8cae602..ad248ff 100644
--- a/recipes/kythe.expected/try.json
+++ b/recipes/kythe.expected/try.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "flower",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/lockfile.expected/default.json b/recipes/lockfile.expected/default.json
index 097efcc..080a981 100644
--- a/recipes/lockfile.expected/default.json
+++ b/recipes/lockfile.expected/default.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "minimal",
       "https://fuchsia.googlesource.com"
     ],
diff --git a/recipes/luci_config.expected/cq_new_builder.json b/recipes/luci_config.expected/cq_new_builder.json
index e14c2f1..4543f36 100644
--- a/recipes/luci_config.expected/cq_new_builder.json
+++ b/recipes/luci_config.expected/cq_new_builder.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/infra",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/luci_config.expected/deleting_cq_builder.json b/recipes/luci_config.expected/deleting_cq_builder.json
index 3a96c60..0afc697 100644
--- a/recipes/luci_config.expected/deleting_cq_builder.json
+++ b/recipes/luci_config.expected/deleting_cq_builder.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/infra",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/luci_config.expected/first_file_invalid.json b/recipes/luci_config.expected/first_file_invalid.json
index 5b6a727..b567fa1 100644
--- a/recipes/luci_config.expected/first_file_invalid.json
+++ b/recipes/luci_config.expected/first_file_invalid.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/infra",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/luci_config.expected/starlark.json b/recipes/luci_config.expected/starlark.json
index f8d243e..aa500a8 100644
--- a/recipes/luci_config.expected/starlark.json
+++ b/recipes/luci_config.expected/starlark.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/infra",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/recipes.expected/check_deps_fails.json b/recipes/recipes.expected/check_deps_fails.json
index ed806a5..9c5cdcc 100644
--- a/recipes/recipes.expected/check_deps_fails.json
+++ b/recipes/recipes.expected/check_deps_fails.json
@@ -223,13 +223,27 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/infra/recipes",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
       "-time",
       "-j=8",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/minimal",
       "https://fuchsia.googlesource.com/infra/recipes"
     ],
diff --git a/recipes/recipes.expected/cq_try.json b/recipes/recipes.expected/cq_try.json
index 385e656..72d70be 100644
--- a/recipes/recipes.expected/cq_try.json
+++ b/recipes/recipes.expected/cq_try.json
@@ -223,13 +223,27 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/infra/recipes",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
       "-time",
       "-j=8",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/minimal",
       "https://fuchsia.googlesource.com/infra/recipes"
     ],
diff --git a/recipes/recipes.expected/cq_try_private.json b/recipes/recipes.expected/cq_try_private.json
index d206656..f3a0cbe 100644
--- a/recipes/recipes.expected/cq_try_private.json
+++ b/recipes/recipes.expected/cq_try_private.json
@@ -223,13 +223,27 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/infra/recipes",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
       "-time",
       "-j=8",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest/minimal",
       "https://fuchsia.googlesource.com/infra/recipes"
     ],
diff --git a/recipes/sdk.expected/local_cq.json b/recipes/sdk.expected/local_cq.json
index e7153a7..1e2a921 100644
--- a/recipes/sdk.expected/local_cq.json
+++ b/recipes/sdk.expected/local_cq.json
@@ -223,6 +223,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -230,8 +245,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "fuchsia/topaz/topaz",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/static_checks.expected/default_cq.json b/recipes/static_checks.expected/default_cq.json
index a0b504b..501a9b3 100644
--- a/recipes/static_checks.expected/default_cq.json
+++ b/recipes/static_checks.expected/default_cq.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/manifest",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "fuchsia",
       "https://fuchsia.googlesource.com/manifest"
     ],
diff --git a/recipes/tools.expected/cq_try.json b/recipes/tools.expected/cq_try.json
index dfbf2fc..aaa2aba 100644
--- a/recipes/tools.expected/cq_try.json
+++ b/recipes/tools.expected/cq_try.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/tools",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "tools",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "tools",
       "https://fuchsia.googlesource.com/tools"
     ],
diff --git a/recipes/tricium/tricium.expected/attribute_disable.json b/recipes/tricium/tricium.expected/attribute_disable.json
index 0c88cb9..996a672 100644
--- a/recipes/tricium/tricium.expected/attribute_disable.json
+++ b/recipes/tricium/tricium.expected/attribute_disable.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "flower",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/tricium/tricium.expected/default.json b/recipes/tricium/tricium.expected/default.json
index 07e5dbd..13e16e4 100644
--- a/recipes/tricium/tricium.expected/default.json
+++ b/recipes/tricium/tricium.expected/default.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "flower",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/tricium/tricium.expected/one_analysis_fails.json b/recipes/tricium/tricium.expected/one_analysis_fails.json
index f10df86..f7aab15 100644
--- a/recipes/tricium/tricium.expected/one_analysis_fails.json
+++ b/recipes/tricium/tricium.expected/one_analysis_fails.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "flower",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/tricium/tricium.expected/with_cipd_packages.json b/recipes/tricium/tricium.expected/with_cipd_packages.json
index 7cc6490..26fdcb3 100644
--- a/recipes/tricium/tricium.expected/with_cipd_packages.json
+++ b/recipes/tricium/tricium.expected/with_cipd_packages.json
@@ -179,6 +179,20 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/integration",
+      "master"
+    ],
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +200,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "flower",
       "https://fuchsia.googlesource.com/integration"
     ],
diff --git a/recipes/zbi_test.expected/affected_tests_no_work.json b/recipes/zbi_test.expected/affected_tests_no_work.json
index 3f6f0df..a3f22c5 100644
--- a/recipes/zbi_test.expected/affected_tests_no_work.json
+++ b/recipes/zbi_test.expected/affected_tests_no_work.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipes/zbi_test.expected/arm64-fail.json b/recipes/zbi_test.expected/arm64-fail.json
index 10ba4da..678040b 100644
--- a/recipes/zbi_test.expected/arm64-fail.json
+++ b/recipes/zbi_test.expected/arm64-fail.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipes/zbi_test.expected/skip_if_unaffected.json b/recipes/zbi_test.expected/skip_if_unaffected.json
index cbb6d15..ce5520d 100644
--- a/recipes/zbi_test.expected/skip_if_unaffected.json
+++ b/recipes/zbi_test.expected/skip_if_unaffected.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest",
       "https://fuchsia.googlesource.com/fuchsia"
     ],
diff --git a/recipes/zbi_test.expected/x64-fail.json b/recipes/zbi_test.expected/x64-fail.json
index bd3b852..287c481 100644
--- a/recipes/zbi_test.expected/x64-fail.json
+++ b/recipes/zbi_test.expected/x64-fail.json
@@ -179,6 +179,21 @@
   },
   {
     "cmd": [
+      "git",
+      "ls-remote",
+      "--heads",
+      "https://fuchsia.googlesource.com/fuchsia",
+      "master"
+    ],
+    "cwd": "[START_DIR]/fuchsia",
+    "infra_step": true,
+    "name": "checkout.resolve HEAD",
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@"
+    ]
+  },
+  {
+    "cmd": [
       "[CACHE]/cipd/fuchsia/tools/jiri/pinned-jiri-version/jiri",
       "import",
       "-vv",
@@ -186,8 +201,8 @@
       "-j=8",
       "-name",
       "integration",
-      "-remote-branch",
-      "master",
+      "-revision",
+      "h3ll0",
       "manifest",
       "https://fuchsia.googlesource.com/fuchsia"
     ],