Skip to content

Commit 452ebf5

Browse files
committed
feat(test.rs): Clone only 1 layer in build_system
1 parent 6afabce commit 452ebf5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build_system/src/test.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -499,17 +499,29 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
499499
&"clone",
500500
&"https://github.com/rust-lang/rust.git",
501501
&rust_dir_path,
502+
&"--depth",
503+
&"1",
502504
],
503505
None,
504506
Some(env),
505507
);
506508
let rust_dir: Option<&Path> = Some(&rust_dir_path);
507509
run_command(&[&"git", &"checkout", &"--", &"tests/"], rust_dir)?;
508-
run_command_with_output_and_env(&[&"git", &"fetch"], rust_dir, Some(env))?;
509510
let rustc_commit = match rustc_version_info(env.get("RUSTC").map(|s| s.as_str()))?.commit_hash {
510511
Some(commit_hash) => commit_hash,
511512
None => return Err("Couldn't retrieve rustc commit hash".to_string()),
512513
};
514+
run_command_with_output_and_env(
515+
&[
516+
&"git",
517+
&"fetch",
518+
&"https://github.com/rust-lang/rust.git",
519+
&rustc_commit.as_str(),
520+
&"--depth=1",
521+
],
522+
rust_dir,
523+
Some(env),
524+
)?;
513525
if rustc_commit != "unknown" {
514526
run_command_with_output_and_env(
515527
&[&"git", &"checkout", &rustc_commit],

0 commit comments

Comments
 (0)