@@ -499,42 +499,17 @@ 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" ,
504502 ] ,
505503 None ,
506504 Some ( env) ,
507505 ) ;
508506 let rust_dir: Option < & Path > = Some ( & rust_dir_path) ;
509507 run_command ( & [ & "git" , & "checkout" , & "--" , & "tests/" ] , rust_dir) ?;
508+ run_command_with_output_and_env ( & [ & "git" , & "fetch" ] , rust_dir, Some ( env) ) ?;
510509 let rustc_commit = match rustc_version_info ( env. get ( "RUSTC" ) . map ( |s| s. as_str ( ) ) ) ?. commit_hash {
511510 Some ( commit_hash) => commit_hash,
512511 None => return Err ( "Couldn't retrieve rustc commit hash" . to_string ( ) ) ,
513512 } ;
514- let has_commit = {
515- if let Ok ( ty) = run_command_with_env (
516- & [ & "git" , & "cat-file" , & "-t" , & rustc_commit. as_str ( ) ] ,
517- rust_dir,
518- Some ( env) ,
519- ) {
520- String :: from_utf8_lossy ( & ty. stdout ) . to_string ( ) == "commit"
521- } else {
522- false
523- }
524- } ;
525- if !has_commit {
526- run_command_with_output_and_env (
527- & [
528- & "git" ,
529- & "fetch" ,
530- & "https://github.com/rust-lang/rust.git" ,
531- & rustc_commit. as_str ( ) ,
532- & "--depth=1" ,
533- ] ,
534- rust_dir,
535- Some ( env) ,
536- ) ?
537- } ;
538513 if rustc_commit != "unknown" {
539514 run_command_with_output_and_env (
540515 & [ & "git" , & "checkout" , & rustc_commit] ,
0 commit comments