File tree 2 files changed +49
-2
lines changed
2 files changed +49
-2
lines changed Original file line number Diff line number Diff line change @@ -1521,8 +1521,7 @@ impl TomlManifest {
1521
1521
d. rev . take ( ) ;
1522
1522
// registry specifications are elaborated to the index URL
1523
1523
if let Some ( registry) = d. registry . take ( ) {
1524
- let src = SourceId :: alt_registry ( config, & registry) ?;
1525
- d. registry_index = Some ( src. url ( ) . to_string ( ) ) ;
1524
+ d. registry_index = Some ( config. get_registry_index ( & registry) ?. to_string ( ) ) ;
1526
1525
}
1527
1526
Ok ( TomlDependency :: Detailed ( d) )
1528
1527
}
Original file line number Diff line number Diff line change @@ -1337,3 +1337,51 @@ source = "sparse+http://[..]/"
1337
1337
checksum = "f6a200a9339fef960979d94d5c99cbbfd899b6f5a396a55d9775089119050203""# ,
1338
1338
) ;
1339
1339
}
1340
+
1341
+ #[ cargo_test]
1342
+ fn publish_with_transitive_dep ( ) {
1343
+ let _alt1 = RegistryBuilder :: new ( )
1344
+ . http_api ( )
1345
+ . http_index ( )
1346
+ . alternative_named ( "Alt-1" )
1347
+ . build ( ) ;
1348
+ let _alt2 = RegistryBuilder :: new ( )
1349
+ . http_api ( )
1350
+ . http_index ( )
1351
+ . alternative_named ( "Alt-2" )
1352
+ . build ( ) ;
1353
+
1354
+ let p1 = project ( )
1355
+ . file (
1356
+ "Cargo.toml" ,
1357
+ r#"
1358
+ [package]
1359
+ name = "a"
1360
+ version = "0.5.0"
1361
+ "# ,
1362
+ )
1363
+ . file ( "src/lib.rs" , "" )
1364
+ . build ( ) ;
1365
+ p1. cargo ( "publish -Zsparse-registry --registry Alt-1" )
1366
+ . masquerade_as_nightly_cargo ( & [ "sparse-registry" ] )
1367
+ . run ( ) ;
1368
+
1369
+ let p2 = project ( )
1370
+ . file (
1371
+ "Cargo.toml" ,
1372
+ r#"
1373
+ [package]
1374
+ name = "b"
1375
+ version = "0.6.0"
1376
+ publish = ["Alt-2"]
1377
+
1378
+ [dependencies]
1379
+ a = { version = "0.5.0", registry = "Alt-1" }
1380
+ "# ,
1381
+ )
1382
+ . file ( "src/lib.rs" , "" )
1383
+ . build ( ) ;
1384
+ p2. cargo ( "publish -Zsparse-registry" )
1385
+ . masquerade_as_nightly_cargo ( & [ "sparse-registry" ] )
1386
+ . run ( ) ;
1387
+ }
You can’t perform that action at this time.
0 commit comments