mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Use strip_path_canonical for getting the relative path
This resolve an issue where the package path contains a symlink that's resolved by git
This commit is contained in:
parent
45c390a2a5
commit
312e2aab7f
@ -533,8 +533,9 @@ fn check_repo_state(
|
||||
if let Some(workdir) = repo.workdir() {
|
||||
debug!("found a git repo at {:?}", workdir);
|
||||
let path = p.manifest_path();
|
||||
let path = path.strip_prefix(workdir).unwrap_or(path);
|
||||
if let Ok(status) = repo.status_file(path) {
|
||||
let path =
|
||||
paths::strip_prefix_canonical(path, workdir).unwrap_or_else(|_| path.to_path_buf());
|
||||
if let Ok(status) = repo.status_file(&path) {
|
||||
if (status & git2::Status::IGNORED).is_empty() {
|
||||
debug!(
|
||||
"found (git) Cargo.toml at {:?} in workdir {:?}",
|
||||
|
@ -3538,7 +3538,7 @@ fn symlink_manifest_path() {
|
||||
warning: manifest has no description, license, license-file, documentation, homepage or repository.
|
||||
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
|
||||
[PACKAGING] foo v1.0.0 ([..]foo-symlink)
|
||||
[PACKAGED] 5 files[..]
|
||||
[PACKAGED] 6 files[..]
|
||||
",
|
||||
)
|
||||
.run()
|
||||
|
Loading…
x
Reference in New Issue
Block a user