Skip to content

Commit 93a5123

Browse files
committed
Fix pathless config patch shadowing detection
When a manifest has a path-less patch entry (git or registry) and the config also has a path-less patch entry with the same key, the config entry should shadow the manifest entry. However, the comparison '*p != own' evaluates to 'None != None' which is false, causing the shadowing to not be detected. Changed the condition to '!(p.is_some() && *p == own)' which properly detects shadowing for path-less entries while preserving the same-path exception for entries with matching paths.
1 parent 52230be commit 93a5123

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • crates/socket-patch-core/src/vex/discover

‎crates/socket-patch-core/src/vex/discover/cargo.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ impl Shadow {
14351435
let own = path.map(same_path_key);
14361436
self.config_keys
14371437
.iter()
1438-
.find(|(_, k, p)| k == key && *p != own)
1438+
.find(|(_, k, p)| k == key && !(p.is_some() && *p == own))
14391439
.map(|(file, k, _)| {
14401440
format!("{file} redefines `[patch]` key `{k}`, which replaces it in cargo")
14411441
})

0 commit comments

Comments
 (0)