Skip to content

Commit f87fc9f

Browse files
mikolalysenkoclaude
andcommitted
Fix review findings on Cargo [patch] shadowing and bypass details
Review on #2024 (/code-review high), round 4: - The "resolves it only from other Socket patches" diagnostic fired beside a same-version crates.io twin; it now needs a lock with no non-Socket entry of the crate. - Shadow resolves a [patch.<registry>] table through the config's [registries] index, so a config [patch."<index>"] item shadows it. - An identical path-less Socket registry [patch] pin in the manifest and the config is the same wiring, not a shadow. - patched_by (registry-index) and same_patch_source share patch_source_key, with CanonicalUrl rules on both. - patch_bypassed's conflict-gate check matches the CLI's bypassed_ref (file-scoped marks only); it routes each declaration once; its detail also names other-patch declarations; a git lock entry a git [patch] table redirects gets the stale/re-lock remedy. - Reuse patch::redirect::is_crates_io_source for lock sources. - Move the manifests comment back above its vector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5d99eb0 commit f87fc9f

2 files changed

Lines changed: 229 additions & 70 deletions

File tree

‎crates/socket-patch-core/src/patch/redirect/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2538,7 +2538,7 @@ fn cargo_manifest_package_id(
25382538
/// in either the git-index or the sparse spelling. Compared the way cargo's
25392539
/// `CanonicalUrl` does: host casing, a trailing `/` and a `.git` suffix do
25402540
/// not make a different source (and github paths are case-insensitive).
2541-
fn is_crates_io_source(source: &str) -> bool {
2541+
pub(crate) fn is_crates_io_source(source: &str) -> bool {
25422542
let url = source.trim();
25432543
let url = url
25442544
.strip_prefix("registry+")

0 commit comments

Comments
 (0)