Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/cargo/sources/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,10 +991,6 @@ fn read_packages(
source_id: SourceId,
gctx: &GlobalContext,
) -> CargoResult<HashMap<PackageId, Vec<Package>>> {
// Normalize for consistency.
// See https://github.com/rust-lang/cargo/issues/15981
// Otherwise, a `CARGO_HOME` with `..` can collect a package twice and incorrectly warn about a duplicate.
let path = &paths::normalize_path(path);
let mut all_packages = HashMap::default();
let mut visited = HashSet::<PathBuf>::default();
let mut errors = Vec::<anyhow::Error>::new();
Expand Down
7 changes: 6 additions & 1 deletion src/cargo/util/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2186,7 +2186,12 @@ impl GlobalContext {
}

pub fn homedir(cwd: &Path) -> Option<PathBuf> {
::home::cargo_home_with_cwd(cwd).ok()
::home::cargo_home_with_cwd(cwd)
.ok()
// https://github.com/rust-lang/cargo/issues/15981
// This is so everything shares one spelling and
// isn't incorrectly seen as distinct.
.map(|home| paths::normalize_path(&home))
}

pub fn save_credentials(
Expand Down