File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -1425,6 +1425,56 @@ edition = "2021"
1425
1425
) ;
1426
1426
}
1427
1427
1428
+ #[ cargo_test]
1429
+ fn dirty_file_outside_pkg_root_inside_submodule ( ) {
1430
+ if !symlink_supported ( ) {
1431
+ return ;
1432
+ }
1433
+ let ( p, repo) = git:: new_repo ( "foo" , |p| {
1434
+ p. file (
1435
+ "Cargo.toml" ,
1436
+ r#"
1437
+ [workspace]
1438
+ members = ["isengard"]
1439
+ resolver = "2"
1440
+ "# ,
1441
+ )
1442
+ . file (
1443
+ "isengard/Cargo.toml" ,
1444
+ r#"
1445
+ [package]
1446
+ name = "isengard"
1447
+ edition = "2015"
1448
+ homepage = "saruman"
1449
+ description = "saruman"
1450
+ license = "ISC"
1451
+ "# ,
1452
+ )
1453
+ . file ( "isengard/src/lib.rs" , "" )
1454
+ } ) ;
1455
+ let submodule = git:: new ( "submodule" , |p| {
1456
+ p. no_manifest ( ) . file ( "file.txt" , "from-submodule" )
1457
+ } ) ;
1458
+ git:: add_submodule (
1459
+ & repo,
1460
+ & submodule. root ( ) . to_url ( ) . to_string ( ) ,
1461
+ Path :: new ( "submodule" ) ,
1462
+ ) ;
1463
+ p. symlink ( "submodule/file.txt" , "isengard/src/file.txt" ) ;
1464
+ git:: add ( & repo) ;
1465
+ git:: commit ( & repo) ;
1466
+ // This dirtyness should be detected in the future.
1467
+ p. change_file ( "submodule/file.txt" , "changed" ) ;
1468
+
1469
+ p. cargo ( "package --workspace --no-verify" )
1470
+ . with_status ( 101 )
1471
+ . with_stderr_data ( str![ [ r#"
1472
+ [ERROR] attempt to get status of nonexistent file 'submodule/file.txt'; class=Invalid (3); code=NotFound (-3)
1473
+
1474
+ "# ] ] )
1475
+ . run ( ) ;
1476
+ }
1477
+
1428
1478
#[ cargo_test]
1429
1479
fn issue_13695_allow_dirty_vcs_info ( ) {
1430
1480
let p = project ( )
You can’t perform that action at this time.
0 commit comments