Normalize equivalent git remotes in allod patch identity checks #92
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
allod patch receiverejects a valid patch transfer when the source and destination clones use different URL forms for the same GitHub repository.Observed while transferring a TriangleBitDevs commit from
nix-devtonexus:The manifest remote and destination remote identify the same GitHub repo, but
patch_applycompares raworiginURLs byte-for-byte.Expected behavior
allod patch apply/receiveshould accept equivalent remote identities across common Git URL forms, at least:It should still reject truly different repos.
Implementation notes
Current flow:
patch_fetchrecordsrepo_remote=$(git -C "$repo" remote get-url origin)inmanifest.json.patch_applyreads.repo_remote, reads destinationgit remote get-url origin, and exits 13 if the strings differ.A small normalization helper before comparison would likely be enough. Normalize scheme/user/host/path for known safe forms, lowercase the host, strip a trailing
.git, and compare canonicalhost/owner/repoidentities. For unrecognized URL forms, keep the current exact-string behavior or fail closed.Workaround
Align the source and destination
originURLs manually, or apply the preserved artifact after changing one remote URL.