[8.4.0] Disable the repo contents cache by default (#26802)

cc @fmeum @meteorcloudy
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
index a16b73c..f66ba5e 100644
--- a/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java
@@ -52,7 +52,7 @@
       name = "repo_contents_cache",
       oldName = "repository_contents_cache",
       oldNameWarning = false,
-      defaultValue = "null",
+      defaultValue = "",
       documentationCategory = OptionDocumentationCategory.BAZEL_CLIENT_OPTIONS,
       effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION},
       converter = OptionsUtils.PathFragmentConverter.class,
@@ -60,9 +60,7 @@
           """
           Specifies the location of the repo contents cache, which contains fetched repo \
           directories shareable across workspaces. An empty string as argument requests the repo \
-          contents cache to be disabled, otherwise the default of '<--repository_cache>/contents' \
-          is used. Note that this means setting '--repository_cache=' would by default disable the \
-          repo contents cache as well, unless '--repo_contents_cache=<some_path>' is also set.
+          contents cache to be disabled.
           """)
   public PathFragment repoContentsCache;
 
diff --git a/src/test/py/bazel/bzlmod/bazel_fetch_test.py b/src/test/py/bazel/bzlmod/bazel_fetch_test.py
index e9d8957..ccbf333 100644
--- a/src/test/py/bazel/bzlmod/bazel_fetch_test.py
+++ b/src/test/py/bazel/bzlmod/bazel_fetch_test.py
@@ -307,6 +307,11 @@
     self.assertIn('No more Orange Juice!', ''.join(stderr))
 
   def testForceFetchWithRepoCache(self):
+    repo_contents_cache = tempfile.mkdtemp(dir=self._tests_root).replace(
+        '\\', '/'
+    )
+    with open(self.Path('.bazelrc'), 'a') as f:
+      f.write('common --repo_contents_cache=%s\n' % repo_contents_cache)
     self.ScratchFile(
         'MODULE.bazel',
         [
diff --git a/src/test/shell/bazel/external_integration_test.sh b/src/test/shell/bazel/external_integration_test.sh
index d0f21fc..94e2d9c 100755
--- a/src/test/shell/bazel/external_integration_test.sh
+++ b/src/test/shell/bazel/external_integration_test.sh
@@ -326,8 +326,7 @@
 
 function test_cached_across_server_restart() {
   http_archive_helper zip_up
-  local repo_path="$(bazel info output_base)/external/+_repo_rules+endangered"
-  local marker_file="$(realpath $repo_path).recorded_inputs"
+  local marker_file="$(bazel info output_base)/external/@+_repo_rules+endangered.marker"
   echo "<MARKER>"
   cat "${marker_file}"
   echo "</MARKER>"