Skip to content
This repository has been archived by the owner on Jun 21, 2019. It is now read-only.

Commit

Permalink
compare canonical paths
Browse files Browse the repository at this point in the history
Url::to_file_path() doesn't return a canonical path, so we need to canonicalize it in order to compare it to canonical_local_dst correctly.
  • Loading branch information
mykmelez committed May 8, 2018
1 parent 6a5747e commit 1ec0be4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,9 @@ fn sync(workspaces: &[Workspace],
for pkg in resolve.iter() {
if pkg.source_id().is_path() {
let path = pkg.source_id().url().to_file_path().expect("path");
if path.starts_with(canonical_local_dst.as_path()) {
added_crates.push(path);
let canonical_path = path.canonicalize().unwrap_or(path.to_path_buf());
if canonical_path.starts_with(canonical_local_dst.as_path()) {
added_crates.push(canonical_path);
}
continue
}
Expand Down

0 comments on commit 1ec0be4

Please sign in to comment.