@@ -499,42 +499,17 @@ fn setup_rustc(env: &mut Env, args: &TestArg) -> Result<PathBuf, String> {
499
499
& "clone" ,
500
500
& "https://github.com/rust-lang/rust.git" ,
501
501
& rust_dir_path,
502
- & "--depth" ,
503
- & "1" ,
504
502
] ,
505
503
None ,
506
504
Some ( env) ,
507
505
) ;
508
506
let rust_dir: Option < & Path > = Some ( & rust_dir_path) ;
509
507
run_command ( & [ & "git" , & "checkout" , & "--" , & "tests/" ] , rust_dir) ?;
508
+ run_command_with_output_and_env ( & [ & "git" , & "fetch" ] , rust_dir, Some ( env) ) ?;
510
509
let rustc_commit = match rustc_version_info ( env. get ( "RUSTC" ) . map ( |s| s. as_str ( ) ) ) ?. commit_hash {
511
510
Some ( commit_hash) => commit_hash,
512
511
None => return Err ( "Couldn't retrieve rustc commit hash" . to_string ( ) ) ,
513
512
} ;
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
- } ;
538
513
if rustc_commit != "unknown" {
539
514
run_command_with_output_and_env (
540
515
& [ & "git" , & "checkout" , & rustc_commit] ,
0 commit comments