You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #12135 - eval-exec:fix-check_for_file_and_add, r=weihanglo
Fix `check_for_file_and_add`'s check for conflict file
### What does this PR try to resolve?
Fixes#12127
### How should we test and review this PR?
- [x] two unit tests
.file("bar/example/README.md","# example readmdBar")
2565
+
.build();
2566
+
2567
+
p.cargo("package")
2568
+
.with_stderr(
2569
+
"\
2570
+
[PACKAGING] bar v0.0.1 ([CWD]/bar)
2571
+
[VERIFYING] bar v0.0.1 ([CWD]/bar)
2572
+
[COMPILING] bar v0.0.1 ([CWD]/[..])
2573
+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
2574
+
[PACKAGED] [..] files, [..] ([..] compressed)
2575
+
",
2576
+
)
2577
+
.run();
2578
+
}
2579
+
2580
+
#[cargo_test]
2581
+
fnworkspace_conflict_readme(){
2582
+
let p = project()
2583
+
.file(
2584
+
"Cargo.toml",
2585
+
r#"
2586
+
[workspace]
2587
+
members = ["bar"]
2588
+
"#,
2589
+
)
2590
+
.file("README.md","workspace readme")
2591
+
.file(
2592
+
"bar/Cargo.toml",
2593
+
r#"
2594
+
[package]
2595
+
name = "bar"
2596
+
version = "0.0.1"
2597
+
repository = "https://github.com/bar/bar"
2598
+
authors = []
2599
+
license = "MIT"
2600
+
description = "bar"
2601
+
readme = "../README.md"
2602
+
workspace = ".."
2603
+
"#,
2604
+
)
2605
+
.file("bar/src/main.rs","fn main() {}")
2606
+
.file("bar/README.md","# workspace member: Bar")
2607
+
.build();
2608
+
2609
+
p.cargo("package")
2610
+
.with_stderr(
2611
+
"\
2612
+
warning: readme `../README.md` appears to be a path outside of the package, but there is already a file named `README.md` in the root of the package. The archived crate will contain the copy in the root of the package. Update the readme to point to the path relative to the root of the package to remove this warning.
2613
+
[PACKAGING] bar v0.0.1 ([CWD]/bar)
2614
+
[VERIFYING] bar v0.0.1 ([CWD]/bar)
2615
+
[COMPILING] bar v0.0.1 ([CWD]/[..])
2616
+
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
0 commit comments