From 1ec0be41cc6177533499fd16d510f5caa3116752 Mon Sep 17 00:00:00 2001 From: Myk Melez Date: Tue, 8 May 2018 15:44:25 -0700 Subject: [PATCH] compare canonical paths 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. --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index ebff0303..73bcb4fe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 }