@@ -4052,6 +4052,90 @@ src/lib.rs
4052
4052
. run ( ) ;
4053
4053
}
4054
4054
4055
+ #[ cargo_test( public_network_test) ]
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
+ Failed to fetch via Github fast path
4091
+ revspec "+11111b376b93484341c68fbca3ca110ae5cd2790" not found
4092
+
4093
+ Caused by:
4094
+ 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)
4095
+
4096
+ "# ] ] )
4097
+ . run ( ) ;
4098
+ }
4099
+
4100
+ #[ cargo_test]
4101
+ fn git_fetch_cli_false ( ) {
4102
+ let p = project ( )
4103
+ . file (
4104
+ "Cargo.toml" ,
4105
+ r#"
4106
+ [package]
4107
+ name = "foo"
4108
+ version = "0.1.0"
4109
+ edition = "2015"
4110
+
4111
+ [dependencies]
4112
+ bitflags = { git = "https://github.com/rust-lang/bitflags.git", rev="11111b376b93484341c68fbca3ca110ae5cd2790" }
4113
+ "# ,
4114
+ )
4115
+ . file ( "src/lib.rs" , "" )
4116
+ . build ( ) ;
4117
+ p. cargo ( "fetch" )
4118
+ . with_status ( 101 )
4119
+ . with_stderr_data ( str![ [ r#"
4120
+ [UPDATING] git repository `https://github.com/rust-lang/bitflags.git`
4121
+ [ERROR] failed to get `bitflags` as a dependency of package `foo v0.1.0 ([ROOT]/foo)`
4122
+
4123
+ Caused by:
4124
+ failed to load source for dependency `bitflags`
4125
+
4126
+ Caused by:
4127
+ Unable to update https://github.com/rust-lang/bitflags.git?rev=11111b376b93484341c68fbca3ca110ae5cd2790
4128
+
4129
+ Caused by:
4130
+ failed to clone into: [ROOT]/home/.cargo/git/db/bitflags-[HASH]
4131
+
4132
+ Caused by:
4133
+ refspec +11111b376b93484341c68fbca3ca110ae5cd2790 not found on https://github.com/rust-lang/bitflags.git
4134
+
4135
+ "# ] ] )
4136
+ . run ( ) ;
4137
+ }
4138
+
4055
4139
#[ cargo_test]
4056
4140
fn git_worktree_with_bare_original_repo ( ) {
4057
4141
let project = project ( ) . build ( ) ;
0 commit comments