@@ -4052,6 +4052,94 @@ src/lib.rs
40524052 . run ( ) ;
40534053}
40544054
4055+ #[ cargo_test( public_network_test, requires_git) ]
4056+ fn github_fastpath_error_message ( ) {
4057+ let p = project ( )
4058+ . file (
4059+ "Cargo.toml" ,
4060+ r#"
4061+ [package]
4062+ name = "foo"
4063+ version = "0.1.0"
4064+ edition = "2015"
4065+
4066+ [dependencies]
4067+ bitflags = { git = "https://github.com/rust-lang/bitflags.git", rev="11111b376b93484341c68fbca3ca110ae5cd2790" }
4068+ "# ,
4069+ )
4070+ . file ( "src/lib.rs" , "" )
4071+ . build ( ) ;
4072+ p. cargo ( "fetch" )
4073+ . env ( "CARGO_NET_GIT_FETCH_WITH_CLI" , "true" )
4074+ . with_status ( 101 )
4075+ . with_stderr_data ( str![ [ r#"
4076+ [UPDATING] git repository `https://github.com/rust-lang/bitflags.git`
4077+ fatal: remote [ERROR] upload-pack: not our ref 11111b376b93484341c68fbca3ca110ae5cd2790
4078+ [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
4079+
4080+ Caused by:
4081+ failed to load source for dependency `bitflags`
4082+
4083+ Caused by:
4084+ Unable to update https://github.com/rust-lang/bitflags.git?rev=11111b376b93484341c68fbca3ca110ae5cd2790
4085+
4086+ Caused by:
4087+ failed to clone into: [ROOT]/home/.cargo/git/db/bitflags-[HASH]
4088+
4089+ Caused by:
4090+ process didn't exit successfully: `git fetch --no-tags --force --update-head-ok 'https://github.com/rust-lang/bitflags.git' '+11111b376b93484341c68fbca3ca110ae5cd2790:refs/commit/11111b376b93484341c68fbca3ca110ae5cd2790'` ([EXIT_STATUS]: 128)
4091+
4092+ "# ] ] )
4093+ . run ( ) ;
4094+ }
4095+
4096+ #[ cargo_test( public_network_test, requires_git) ]
4097+ fn git_fetch_libgit2_error_message ( ) {
4098+ let p = project ( )
4099+ . file (
4100+ "Cargo.toml" ,
4101+ r#"
4102+ [package]
4103+ name = "foo"
4104+ version = "0.1.0"
4105+ edition = "2015"
4106+
4107+ [dependencies]
4108+ bitflags = { git = "https://github.com/rust-lang/bitflags.git", rev="11111b376b93484341c68fbca3ca110ae5cd2790" }
4109+ "# ,
4110+ )
4111+ . file ( "src/lib.rs" , "" )
4112+ . build ( ) ;
4113+ p. cargo ( "fetch" )
4114+ . with_status ( 101 )
4115+ . with_stderr_data ( str![ [ r#"
4116+ [UPDATING] git repository `https://github.com/rust-lang/bitflags.git`
4117+ [WARNING] spurious network error (3 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20)
4118+ [WARNING] spurious network error (2 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20)
4119+ [WARNING] spurious network error (1 tries remaining): could not read from remote repository; class=Net (12); code=Eof (-20)
4120+ [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
4121+
4122+ Caused by:
4123+ failed to load source for dependency `bitflags`
4124+
4125+ Caused by:
4126+ Unable to update https://github.com/rust-lang/bitflags.git?rev=11111b376b93484341c68fbca3ca110ae5cd2790
4127+
4128+ Caused by:
4129+ failed to clone into: [ROOT]/home/.cargo/git/db/bitflags-[HASH]
4130+
4131+ Caused by:
4132+ network failure seems to have happened
4133+ if a proxy or similar is necessary `net.git-fetch-with-cli` may help here
4134+ https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli
4135+
4136+ Caused by:
4137+ could not read from remote repository; class=Net (12); code=Eof (-20)
4138+
4139+ "# ] ] )
4140+ . run ( ) ;
4141+ }
4142+
40554143#[ cargo_test]
40564144fn git_worktree_with_bare_original_repo ( ) {
40574145 let project = project ( ) . build ( ) ;
0 commit comments