about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-02-17 20:04:17 +0100
committerGitHub <noreply@github.com>2024-02-17 20:04:17 +0100
commit0a66c555bd4e8599e9710652509bfbdca366f36d (patch)
treeabe8c3ba7519a8545c0893ed7203613c07cb02ba
parent79c8780d84756c834b8b91cd8c1bb955e1555b46 (diff)
downloadrust-0a66c555bd4e8599e9710652509bfbdca366f36d.tar.gz
rust-0a66c555bd4e8599e9710652509bfbdca366f36d.zip
Revert "Use shallow clone in test.rs to reduce cloning overhead"
-rw-r--r--build_system/src/test.rs27
1 files changed, 1 insertions, 26 deletions
diff --git a/build_system/src/test.rs b/build_system/src/test.rs
index 9fe9708c291..d7f7a0eb47e 100644
--- a/build_system/src/test.rs
+++ b/build_system/src/test.rs
@@ -499,42 +499,17 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
             &"clone",
             &"https://github.com/rust-lang/rust.git",
             &rust_dir_path,
-            &"--depth",
-            &"1",
         ],
         None,
         Some(env),
     );
     let rust_dir: Option<&Path> = Some(&rust_dir_path);
     run_command(&[&"git", &"checkout", &"--", &"tests/"], rust_dir)?;
+    run_command_with_output_and_env(&[&"git", &"fetch"], rust_dir, Some(env))?;
     let rustc_commit = match rustc_version_info(env.get("RUSTC").map(|s| s.as_str()))?.commit_hash {
         Some(commit_hash) => commit_hash,
         None => return Err("Couldn't retrieve rustc commit hash".to_string()),
     };
-    let has_commit = {
-        if let Ok(ty) = run_command_with_env(
-            &[&"git", &"cat-file", &"-t", &rustc_commit.as_str()],
-            rust_dir,
-            Some(env),
-        ) {
-            String::from_utf8_lossy(&ty.stdout).to_string() == "commit"
-        } else {
-            false
-        }
-    };
-    if !has_commit {
-        run_command_with_output_and_env(
-            &[
-                &"git",
-                &"fetch",
-                &"https://github.com/rust-lang/rust.git",
-                &rustc_commit.as_str(),
-                &"--depth=1",
-            ],
-            rust_dir,
-            Some(env),
-        )?
-    };
     if rustc_commit != "unknown" {
         run_command_with_output_and_env(
             &[&"git", &"checkout", &rustc_commit],