@@ -9,14 +9,13 @@ use std::str;
9
9
use lazycell:: LazyCell ;
10
10
use log:: { debug, trace} ;
11
11
12
- use crate :: core:: { nightly_features_allowed , PackageId , SourceId } ;
12
+ use crate :: core:: { PackageId , SourceId } ;
13
13
use crate :: sources:: git;
14
14
use crate :: sources:: registry:: MaybeLock ;
15
15
use crate :: sources:: registry:: {
16
16
RegistryConfig , RegistryData , CRATE_TEMPLATE , INDEX_LOCK , VERSION_TEMPLATE ,
17
17
} ;
18
18
use crate :: util:: errors:: { CargoResult , CargoResultExt } ;
19
- use crate :: util:: network:: maybe_spurious;
20
19
use crate :: util:: { Config , Sha256 } ;
21
20
use crate :: util:: { FileLock , Filesystem } ;
22
21
@@ -221,18 +220,8 @@ impl<'cfg> RegistryData for RemoteRegistry<'cfg> {
221
220
let url = self . source_id . url ( ) ;
222
221
let refspec = "refs/heads/master:refs/remotes/origin/master" ;
223
222
let repo = self . repo . borrow_mut ( ) . unwrap ( ) ;
224
- let result = git:: fetch ( repo, url, refspec, self . config ) ;
225
- if let Err ( e) = result {
226
- let extra = if maybe_spurious ( & e) && nightly_features_allowed ( ) && !repo. is_empty ( ) ? {
227
- "\n If the network is unavailable, consider running with the -Zoffline \
228
- flag to run in offline mode."
229
- } else {
230
- ""
231
- } ;
232
- return Err ( e
233
- . context ( format ! ( "failed to fetch `{}`{}" , url, extra) )
234
- . into ( ) ) ;
235
- }
223
+ git:: fetch ( repo, url, refspec, self . config )
224
+ . chain_err ( || format ! ( "failed to fetch `{}`" , url) ) ?;
236
225
self . config . updated_sources ( ) . insert ( self . source_id ) ;
237
226
Ok ( ( ) )
238
227
}
0 commit comments