Skip to content

Commit 014e516

Browse files
committed
test(package): symlink dirty also under dirtiness check
This show that a regular file under a symlink directory is also not tarcked by the current vcs dirtiness check.
1 parent aaac688 commit 014e516

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/testsuite/package.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,10 +1339,12 @@ fn dirty_file_outside_pkg_root_considered_dirty() {
13391339
license-file = "../LICENSE"
13401340
"#,
13411341
)
1342+
.file("original-dir/file", "before")
13421343
.symlink("lib.rs", "isengard/src/lib.rs")
13431344
.symlink("README.md", "isengard/README.md")
13441345
.file(&main_outside_pkg_root, "fn main() {}")
13451346
.symlink(&main_outside_pkg_root, "isengard/src/main.rs")
1347+
.symlink_dir("original-dir", "isengard/symlink-dir")
13461348
});
13471349
git::commit(&repo);
13481350

@@ -1352,6 +1354,7 @@ fn dirty_file_outside_pkg_root_considered_dirty() {
13521354
// * Changes in files outside package root that source files symlink to
13531355
p.change_file("README.md", "after");
13541356
p.change_file("lib.rs", "pub fn after() {}");
1357+
p.change_file("original-dir/file", "after");
13551358
// * Changes in files outside pkg root that `license-file`/`readme` point to
13561359
p.change_file("LICENSE", "after");
13571360
// * When workspace inheritance is involved and changed
@@ -1388,7 +1391,7 @@ to proceed despite this and include the uncommitted changes, pass the `--allow-d
13881391
p.cargo("package --workspace --no-verify --allow-dirty")
13891392
.with_stderr_data(str![[r#"
13901393
[PACKAGING] isengard v0.0.0 ([ROOT]/foo/isengard)
1391-
[PACKAGED] 8 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
1394+
[PACKAGED] 9 files, [FILE_SIZE]B ([FILE_SIZE]B compressed)
13921395
13931396
"#]])
13941397
.run();
@@ -1411,13 +1414,15 @@ edition = "2021"
14111414
"Cargo.toml.orig",
14121415
"src/lib.rs",
14131416
"src/main.rs",
1417+
"symlink-dir/file",
14141418
"Cargo.lock",
14151419
"LICENSE",
14161420
"README.md",
14171421
],
14181422
[
14191423
("src/lib.rs", str!["pub fn after() {}"]),
14201424
("src/main.rs", str![r#"fn main() { eprintln!("after"); }"#]),
1425+
("symlink-dir/file", str!["after"]),
14211426
("README.md", str!["after"]),
14221427
("LICENSE", str!["after"]),
14231428
("Cargo.toml", cargo_toml),

0 commit comments

Comments
 (0)